Ask Your Question
1

can not use pre-built binary

asked 2016-04-05 17:33:39 +0100

this post is marked as community wiki

This post is a wiki. Anyone with karma >750 is welcome to improve it.

I am trying to use the pre-built binary for Ubuntu 15.10, sage-7.1-Ubuntu_15.10-x86_64.tar.bz2. I have extracted it with tar -xvf sage-7.1-Ubuntu_15.10-x86_64.tar.bz2. And it creates the folder SageMath. When I try to run ./sage for the first time from the extracted folder I have the result below. Is it normal? What can I do to run sage?

.../SageMath$ ./sage
  File "/home/ste/Downloads/SageMath/relocate-once.py", line 12
    print "relocate-once.py -d <destination>"
                                        ^
SyntaxError: Missing parentheses in call to 'print'
┌────────────────────────────────────────────────────────────────────┐
│ SageMath Version 7.1, Release Date: 2016-03-20                     │
│ Type "notebook()" for the browser-based notebook interface.        │
│ Type "help()" for help.                                            │
└────────────────────────────────────────────────────────────────────┘

ERROR:  The Sage installation tree has moved

from /home/buildbot/slave/binary_pkg/build/source/SageMath/jc4b6yulaujayb9sr94ia88eourzeqip0oidmas391yaj2
  to /home/ste/Downloads/SageMath
...

Solved: I use python 3.5, but apparently, in order to run sage for the first time, you should use python 2.7

edit retag flag offensive close merge delete

3 Answers

Sort by » oldest newest most voted
0

answered 2016-04-06 12:48:45 +0100

this post is marked as community wiki

This post is a wiki. Anyone with karma >750 is welcome to improve it.

In my specific case I use anaconda3 (which uses python 3.5) with an entry in my ~/.bashrc file which includes the anaconda bin folder to the path.

In order to run sage for the first time I have commented the line in .bashrc corresponding to the anaconda bin folder. Then after running successfully sage for the first time I have removed the comment and everything seems to work.

edit flag offensive delete link more
1

answered 2016-04-05 20:15:32 +0100

This is a bug in Sage. In the file relocate-once.py, try replacing

print "relocate-once.py -d <destination>"

with

print("relocate-once.py -d <destination>")

(Alternatively, if the first line of the file is !#/usr/bin/env python, try changing that to !#/usr/bin/env python2.)

edit flag offensive delete link more
1

answered 2016-04-06 03:16:30 +0100

tmonteil gravatar image

It seems your system is using python3 by default, which is unusual. What do the following commands answer:

 /usr/bin/env python --version

If it answers Python 3.x, then a possibility could be to use a virtual environment so that, locally, the default version is 2.7 as follows:

  • install the virtualenv package
  • create the virtual environment:

    virtualenv -p /usr/bin/python2.7 venv2.7
    
  • activate the virtualenv (don't forget the leading dot)

    . venv2.7/bin/activate
    
  • run your Sage commands

  • deactivate the virtualenv:

    deactivate
    
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-04-05 17:33:39 +0100

Seen: 721 times

Last updated: Apr 06 '16