[sage-devel] Re: FriCAS and Sage Math v8.1 Ubuntu package

2018-11-14 Thread Samuel Lelievre
Tue 2018-11-13 17:31:47 UTC+1, James Womack:
> I am right to think that installing packages in this way requires
> that I have compiled Sage Math from source? In that case,
> I may need to switch from the binary version in the Ubuntu
> repositories back to compiling from source.

If I understand correctly, either you install SageMath from source
and then you can use "sage -i ..." to install extra packages,
or you install SageMath from some package manager, e.g. from
the Ubuntu package manager, and then if you want FriCAS you
need to install it on its own, make sure it's in the PATH, and then
Sage should be able to talk to it.

FriCAS does not seem to be packaged in Ubuntu,

https://packages.ubuntu.com/search?keywords=sagemath
https://repology.org/metapackage/fricas/versions

but the Fricas documentation page

http://fricas.sourceforge.net/doc/

has links to "install from source" and "install from binaries":

http://fricas.sourceforge.net/doc/INSTALL.txt
http://fricas.sourceforge.net/doc/INSTALL-bin.txt

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Re: FriCAS and Sage Math v8.1 Ubuntu package

2018-11-14 Thread TB

On 14/11/2018 11:53, James Womack wrote:
Thanks. I actually decided to go ahead and build from source. It's a 
good excuse to get the latest stable version and avoids permissions 
issues when adding optional components --- I can install in a directory 
owned by a normal user.


Perhaps in future, optional packages could be made available via the 
distribution package manager? I think this is how TeX Live works on 
Debian/Ubuntu. There are a number of packages which group together 
optional TeX Live components, such as fonts.


FriCAS does not seem to have a package in the Debian and Ubuntu 
repositories at the moment, but axiom does.
Other than that, I assume it will be possible to use another install of 
FriCAS using sage.interfaces.fricas just by adjusting the command there 
(not tested):


sage: new_fricas = FriCAS(command="/path/to/new/fricas -nosman")
sage: new_fricas("1+1")
2

Regards,
TB

--
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Re: FriCAS and Sage Math v8.1 Ubuntu package

2018-11-14 Thread James Womack
Thanks. I actually decided to go ahead and build from source. It's a good 
excuse to get the latest stable version and avoids permissions issues when 
adding optional components --- I can install in a directory owned by a 
normal user.

Perhaps in future, optional packages could be made available via the 
distribution package manager? I think this is how TeX Live works on 
Debian/Ubuntu. There are a number of packages which group together optional 
TeX Live components, such as fonts.

On Tuesday, 13 November 2018 16:54:07 UTC, Dima Pasechnik wrote:
>
>
>
> On Tue, 13 Nov 2018 at 11:31, James Womack  > wrote:
>
>> Thank you. I suspect you are right. 
>>
>> I am right to think that installing packages in this way requires that I 
>> have compiled Sage Math from source? In that case, I may need to switch 
>> from the binary version in the Ubuntu repositories back to compiling from 
>> source.
>>
>
> in theory you could do it with a binary install, in practice it might be 
> broken.
> Try and see if   sage -i fricas  works.
>
> James
>>
>> On Tuesday, 13 November 2018 16:07:07 UTC, John H Palmieri wrote:
>>>
>>> FriCAS is an optional Sage package, so it is not automatically 
>>> installed. If you have built from source, you can easily install it (with 
>>> "sage -i fricas"), and maybe that's what you did before.
>>>
>>>   John
>>>
>>>
>>> On Tuesday, November 13, 2018 at 7:22:49 AM UTC-8, James Womack wrote:

 I am using Sage Math installed from the Ubuntu 18.04 LTS repositories (
 https://packages.ubuntu.com/search?keywords=sagemath).

 I was previously using Sage Math v8.1 installed from source, but when I 
 upgraded to 18.04 LTS opted for the easier to install and update package.

 I'm a bit puzzled because (I think) my previous installation from 
 source was packaged with FriCAS, but the version from the Ubuntu 
 repositories does not seem to be packaged with this.

 When I try to use the FriCAS interface in the version of Sage Math 
 installed from the repositories, the following exception occurs:

 ---TypeError
  Traceback (most recent call 
 last) in ()> 1 fricas('3 * 5')
 /usr/lib/python2.7/dist-packages/sage/interfaces/interface.pyc in 
 __call__(self, x, name)280 281 if isinstance(x, 
 string_types):--> 282 return cls(self, x, name=name)283
  try:284 return self._coerce_from_special_method(x)
 /usr/lib/python2.7/dist-packages/sage/interfaces/expect.pyc in 
 __init__(self, parent, value, is_name, name)   1386 except 
 (RuntimeError, ValueError) as x:   1387 
 self._session_number = -1-> 1388 raise_(TypeError, x, 
 sys.exc_info()[2])   1389 except BaseException:   1390 
 self._session_number = -1
 /usr/lib/python2.7/dist-packages/sage/interfaces/expect.pyc in 
 __init__(self, parent, value, is_name, name)   1381 else:   1382   
   try:-> 1383 self._name = parent._create(value, 
 name=name)   1384 # Convert ValueError and RuntimeError to 
 TypeError for   1385 # coercion to work properly.
 /usr/lib/python2.7/dist-packages/sage/interfaces/interface.pyc in 
 _create(self, value, name)476 def _create(self, value, name=None): 
477 name = self._next_var_name() if name is None else name--> 
 478 self.set(name, value)479 return name480 
 /usr/lib/python2.7/dist-packages/sage/interfaces/fricas.pyc in set(self, 
 var, value)530 """531 cmd = 
 '%s%s%s;'%(var,self._assign_symbol(), value)--> 532 output = 
 self.eval(cmd, reformat=False)533 self._check_errors(value, 
 output)534 
 /usr/lib/python2.7/dist-packages/sage/interfaces/fricas.pyc in eval(self, 
 code, strip, synchronize, locals, allow_use_file, split_lines, reformat, 
 **kwds)752  synchronize=synchronize, 
 locals=locals,753  
 allow_use_file=allow_use_file, split_lines=split_lines,--> 754 
  **kwds)755 # we remove carriage returns (\r) 
 to make parsing easier756 # they are sent depending on how 
 fricas was invoked:
 /usr/lib/python2.7/dist-packages/sage/interfaces/expect.pyc in eval(self, 
 code, strip, synchronize, locals, allow_use_file, split_lines, **kwds)   
 1295 elif split_lines:   1296 return 
 '\n'.join([self._eval_line(L, allow_use_file=allow_use_file, **kwds)-> 
 1297 for L in code.split('\n') if 
 L != ''])   1298 else:   1299  

Re: [sage-devel] Re: FriCAS and Sage Math v8.1 Ubuntu package

2018-11-13 Thread Dima Pasechnik
On Tue, 13 Nov 2018 at 11:31, James Womack  wrote:

> Thank you. I suspect you are right.
>
> I am right to think that installing packages in this way requires that I
> have compiled Sage Math from source? In that case, I may need to switch
> from the binary version in the Ubuntu repositories back to compiling from
> source.
>

in theory you could do it with a binary install, in practice it might be
broken.
Try and see if   sage -i fricas  works.

James
>
> On Tuesday, 13 November 2018 16:07:07 UTC, John H Palmieri wrote:
>>
>> FriCAS is an optional Sage package, so it is not automatically installed.
>> If you have built from source, you can easily install it (with "sage -i
>> fricas"), and maybe that's what you did before.
>>
>>   John
>>
>>
>> On Tuesday, November 13, 2018 at 7:22:49 AM UTC-8, James Womack wrote:
>>>
>>> I am using Sage Math installed from the Ubuntu 18.04 LTS repositories (
>>> https://packages.ubuntu.com/search?keywords=sagemath).
>>>
>>> I was previously using Sage Math v8.1 installed from source, but when I
>>> upgraded to 18.04 LTS opted for the easier to install and update package.
>>>
>>> I'm a bit puzzled because (I think) my previous installation from source
>>> was packaged with FriCAS, but the version from the Ubuntu repositories does
>>> not seem to be packaged with this.
>>>
>>> When I try to use the FriCAS interface in the version of Sage Math
>>> installed from the repositories, the following exception occurs:
>>>
>>> ---TypeError
>>>  Traceback (most recent call 
>>> last) in ()> 1 fricas('3 * 5')
>>> /usr/lib/python2.7/dist-packages/sage/interfaces/interface.pyc in 
>>> __call__(self, x, name)280 281 if isinstance(x, 
>>> string_types):--> 282 return cls(self, x, name=name)283 
>>> try:284 return self._coerce_from_special_method(x)
>>> /usr/lib/python2.7/dist-packages/sage/interfaces/expect.pyc in 
>>> __init__(self, parent, value, is_name, name)   1386 except 
>>> (RuntimeError, ValueError) as x:   1387 
>>> self._session_number = -1-> 1388 raise_(TypeError, x, 
>>> sys.exc_info()[2])   1389 except BaseException:   1390  
>>>self._session_number = -1
>>> /usr/lib/python2.7/dist-packages/sage/interfaces/expect.pyc in 
>>> __init__(self, parent, value, is_name, name)   1381 else:   1382
>>>  try:-> 1383 self._name = parent._create(value, 
>>> name=name)   1384 # Convert ValueError and RuntimeError to 
>>> TypeError for   1385 # coercion to work properly.
>>> /usr/lib/python2.7/dist-packages/sage/interfaces/interface.pyc in 
>>> _create(self, value, name)476 def _create(self, value, name=None):  
>>>   477 name = self._next_var_name() if name is None else name--> 478 
>>> self.set(name, value)479 return name480
>>> /usr/lib/python2.7/dist-packages/sage/interfaces/fricas.pyc in set(self, 
>>> var, value)530 """531 cmd = 
>>> '%s%s%s;'%(var,self._assign_symbol(), value)--> 532 output = 
>>> self.eval(cmd, reformat=False)533 self._check_errors(value, 
>>> output)534
>>> /usr/lib/python2.7/dist-packages/sage/interfaces/fricas.pyc in eval(self, 
>>> code, strip, synchronize, locals, allow_use_file, split_lines, reformat, 
>>> **kwds)752  synchronize=synchronize, 
>>> locals=locals,753  
>>> allow_use_file=allow_use_file, split_lines=split_lines,--> 754  
>>> **kwds)755 # we remove carriage returns (\r) to 
>>> make parsing easier756 # they are sent depending on how fricas 
>>> was invoked:
>>> /usr/lib/python2.7/dist-packages/sage/interfaces/expect.pyc in eval(self, 
>>> code, strip, synchronize, locals, allow_use_file, split_lines, **kwds)   
>>> 1295 elif split_lines:   1296 return 
>>> '\n'.join([self._eval_line(L, allow_use_file=allow_use_file, **kwds)-> 1297 
>>> for L in code.split('\n') if L != 
>>> ''])   1298 else:   1299 return 
>>> self._eval_line(code, allow_use_file=allow_use_file, **kwds)
>>> /usr/lib/python2.7/dist-packages/sage/interfaces/expect.pyc in 
>>> _eval_line(self, line, allow_use_file, wait_for_prompt, restart_if_needed)  
>>>   905 try:906 if self._expect is None:--> 907   
>>>   self._start()908 E = self._expect909  
>>>try:
>>> /usr/lib/python2.7/dist-packages/sage/interfaces/fricas.pyc in _start(self) 
>>>281 # setting the prompt properly is necessary for restarting 
>>> FriCAS282 self._prompt = FRICAS_FIRST_PROMPT--> 283 
>>> Expect._start(self)

[sage-devel] Re: FriCAS and Sage Math v8.1 Ubuntu package

2018-11-13 Thread James Womack
Thank you. I suspect you are right. 

I am right to think that installing packages in this way requires that I 
have compiled Sage Math from source? In that case, I may need to switch 
from the binary version in the Ubuntu repositories back to compiling from 
source.

James

On Tuesday, 13 November 2018 16:07:07 UTC, John H Palmieri wrote:
>
> FriCAS is an optional Sage package, so it is not automatically installed. 
> If you have built from source, you can easily install it (with "sage -i 
> fricas"), and maybe that's what you did before.
>
>   John
>
>
> On Tuesday, November 13, 2018 at 7:22:49 AM UTC-8, James Womack wrote:
>>
>> I am using Sage Math installed from the Ubuntu 18.04 LTS repositories (
>> https://packages.ubuntu.com/search?keywords=sagemath).
>>
>> I was previously using Sage Math v8.1 installed from source, but when I 
>> upgraded to 18.04 LTS opted for the easier to install and update package.
>>
>> I'm a bit puzzled because (I think) my previous installation from source 
>> was packaged with FriCAS, but the version from the Ubuntu repositories does 
>> not seem to be packaged with this.
>>
>> When I try to use the FriCAS interface in the version of Sage Math 
>> installed from the repositories, the following exception occurs:
>>
>> ---TypeError
>>  Traceback (most recent call 
>> last) in ()> 1 fricas('3 * 5')
>> /usr/lib/python2.7/dist-packages/sage/interfaces/interface.pyc in 
>> __call__(self, x, name)280 281 if isinstance(x, 
>> string_types):--> 282 return cls(self, x, name=name)283  
>>try:284 return self._coerce_from_special_method(x)
>> /usr/lib/python2.7/dist-packages/sage/interfaces/expect.pyc in 
>> __init__(self, parent, value, is_name, name)   1386 except 
>> (RuntimeError, ValueError) as x:   1387 self._session_number 
>> = -1-> 1388 raise_(TypeError, x, sys.exc_info()[2])   1389   
>>   except BaseException:   1390 self._session_number 
>> = -1
>> /usr/lib/python2.7/dist-packages/sage/interfaces/expect.pyc in 
>> __init__(self, parent, value, is_name, name)   1381 else:   1382 
>> try:-> 1383 self._name = parent._create(value, 
>> name=name)   1384 # Convert ValueError and RuntimeError to 
>> TypeError for   1385 # coercion to work properly.
>> /usr/lib/python2.7/dist-packages/sage/interfaces/interface.pyc in 
>> _create(self, value, name)476 def _create(self, value, name=None):   
>>  477 name = self._next_var_name() if name is None else name--> 478   
>>   self.set(name, value)479 return name480 
>> /usr/lib/python2.7/dist-packages/sage/interfaces/fricas.pyc in set(self, 
>> var, value)530 """531 cmd = 
>> '%s%s%s;'%(var,self._assign_symbol(), value)--> 532 output = 
>> self.eval(cmd, reformat=False)533 self._check_errors(value, 
>> output)534 
>> /usr/lib/python2.7/dist-packages/sage/interfaces/fricas.pyc in eval(self, 
>> code, strip, synchronize, locals, allow_use_file, split_lines, reformat, 
>> **kwds)752  synchronize=synchronize, 
>> locals=locals,753  
>> allow_use_file=allow_use_file, split_lines=split_lines,--> 754   
>>**kwds)755 # we remove carriage returns (\r) to 
>> make parsing easier756 # they are sent depending on how fricas 
>> was invoked:
>> /usr/lib/python2.7/dist-packages/sage/interfaces/expect.pyc in eval(self, 
>> code, strip, synchronize, locals, allow_use_file, split_lines, **kwds)   
>> 1295 elif split_lines:   1296 return 
>> '\n'.join([self._eval_line(L, allow_use_file=allow_use_file, **kwds)-> 1297  
>>for L in code.split('\n') if L != 
>> ''])   1298 else:   1299 return 
>> self._eval_line(code, allow_use_file=allow_use_file, **kwds)
>> /usr/lib/python2.7/dist-packages/sage/interfaces/expect.pyc in 
>> _eval_line(self, line, allow_use_file, wait_for_prompt, restart_if_needed)   
>>  905 try:906 if self._expect is None:--> 907 
>> self._start()908 E = self._expect909 
>> try:
>> /usr/lib/python2.7/dist-packages/sage/interfaces/fricas.pyc in _start(self)  
>>   281 # setting the prompt properly is necessary for restarting 
>> FriCAS282 self._prompt = FRICAS_FIRST_PROMPT--> 283 
>> Expect._start(self)284 for line in FRICAS_INIT_CODE:285  
>>self.eval(line, reformat=False)
>> /usr/lib/python2.7/dist-packages/sage/interfaces/expect.pyc in _start(self, 
>> alt_message, block_during_init)489 # Change pexpect 

[sage-devel] Re: FriCAS and Sage Math v8.1 Ubuntu package

2018-11-13 Thread John H Palmieri
FriCAS is an optional Sage package, so it is not automatically installed. 
If you have built from source, you can easily install it (with "sage -i 
fricas"), and maybe that's what you did before.

  John


On Tuesday, November 13, 2018 at 7:22:49 AM UTC-8, James Womack wrote:
>
> I am using Sage Math installed from the Ubuntu 18.04 LTS repositories (
> https://packages.ubuntu.com/search?keywords=sagemath).
>
> I was previously using Sage Math v8.1 installed from source, but when I 
> upgraded to 18.04 LTS opted for the easier to install and update package.
>
> I'm a bit puzzled because (I think) my previous installation from source 
> was packaged with FriCAS, but the version from the Ubuntu repositories does 
> not seem to be packaged with this.
>
> When I try to use the FriCAS interface in the version of Sage Math 
> installed from the repositories, the following exception occurs:
>
> ---TypeError
>  Traceback (most recent call 
> last) in ()> 1 fricas('3 * 5')
> /usr/lib/python2.7/dist-packages/sage/interfaces/interface.pyc in 
> __call__(self, x, name)280 281 if isinstance(x, 
> string_types):--> 282 return cls(self, x, name=name)283   
>   try:284 return self._coerce_from_special_method(x)
> /usr/lib/python2.7/dist-packages/sage/interfaces/expect.pyc in __init__(self, 
> parent, value, is_name, name)   1386 except (RuntimeError, 
> ValueError) as x:   1387 self._session_number = -1-> 1388 
> raise_(TypeError, x, sys.exc_info()[2])   1389 except 
> BaseException:   1390 self._session_number = -1
> /usr/lib/python2.7/dist-packages/sage/interfaces/expect.pyc in __init__(self, 
> parent, value, is_name, name)   1381 else:   1382 try:-> 
> 1383 self._name = parent._create(value, name=name)   1384 
> # Convert ValueError and RuntimeError to TypeError for   1385 
> # coercion to work properly.
> /usr/lib/python2.7/dist-packages/sage/interfaces/interface.pyc in 
> _create(self, value, name)476 def _create(self, value, name=None):
> 477 name = self._next_var_name() if name is None else name--> 478 
> self.set(name, value)479 return name480 
> /usr/lib/python2.7/dist-packages/sage/interfaces/fricas.pyc in set(self, var, 
> value)530 """531 cmd = 
> '%s%s%s;'%(var,self._assign_symbol(), value)--> 532 output = 
> self.eval(cmd, reformat=False)533 self._check_errors(value, 
> output)534 
> /usr/lib/python2.7/dist-packages/sage/interfaces/fricas.pyc in eval(self, 
> code, strip, synchronize, locals, allow_use_file, split_lines, reformat, 
> **kwds)752  synchronize=synchronize, 
> locals=locals,753  
> allow_use_file=allow_use_file, split_lines=split_lines,--> 754
>   **kwds)755 # we remove carriage returns (\r) to 
> make parsing easier756 # they are sent depending on how fricas 
> was invoked:
> /usr/lib/python2.7/dist-packages/sage/interfaces/expect.pyc in eval(self, 
> code, strip, synchronize, locals, allow_use_file, split_lines, **kwds)   1295 
> elif split_lines:   1296 return 
> '\n'.join([self._eval_line(L, allow_use_file=allow_use_file, **kwds)-> 1297   
>   for L in code.split('\n') if L != ''])  
>  1298 else:   1299 return 
> self._eval_line(code, allow_use_file=allow_use_file, **kwds)
> /usr/lib/python2.7/dist-packages/sage/interfaces/expect.pyc in 
> _eval_line(self, line, allow_use_file, wait_for_prompt, restart_if_needed)
> 905 try:906 if self._expect is None:--> 907   
>   self._start()908 E = self._expect909 
> try:
> /usr/lib/python2.7/dist-packages/sage/interfaces/fricas.pyc in _start(self)   
>  281 # setting the prompt properly is necessary for restarting FriCAS 
>282 self._prompt = FRICAS_FIRST_PROMPT--> 283 
> Expect._start(self)284 for line in FRICAS_INIT_CODE:285   
>   self.eval(line, reformat=False)
> /usr/lib/python2.7/dist-packages/sage/interfaces/expect.pyc in _start(self, 
> alt_message, block_during_init)489 # Change pexpect 
> errors to RuntimeError490 raise RuntimeError("unable to 
> start %s because the command %r failed: %s\n%s" %--> 491  
>(self.name(), cmd, e, self._install_hints()))492 except 
> BaseException:493 self._expect = None
> TypeError: unable to start fricas because the command 'fricas -nosman' 
> failed: The command was not found or was not executable: