Ask Your Question

How to use libraries installed in for Python in Sage?

asked 2016-01-23 11:15:39 -0500

mavavilj gravatar image

I've installed some libraries to the 'normal' or 'system' Python on my computer.

However, Sage cannot see them.

How can I get Sage to use the libraries installed for Python? I'd prefer not to double install for Python and Sage separately.

I've noticed that Sage uses some Python from the Sage package. Which is clearly different than the one I'm using as "system Python". Is there a way to make these the same?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2016-01-23 16:49:15 -0500

tmonteil gravatar image

Indeed Sage has its own virtual environment, so it does not share Python libs with the system. Some Linux distributions try to so this but it requires quite some work.

If you want to experiment, you can try to symlink $SAGE_ROOT/local/lib/python22.7/site-packages/some_lib to the one of your system, but it does not awlays work. You can aslo add your system's Python lib directory to the Python path of Sage.

That said,i am not sure it is worth the effort for a single install, so unless you want to participate to some distribution packaging and share your experiments, double installing is currently usually preferable.

Note that you can install a Python library in Sage by typing from a terminal:

sage -pip install some_lib
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


Asked: 2016-01-23 11:08:10 -0500

Seen: 138 times

Last updated: Jan 23 '16