First time here? Check out the FAQ!

Ask Your Question
1

Use system-wide installation of graphviz in sage?

asked 7 years ago

stan gravatar image

I am trying to install pygraphviz in sage 7.3 on a Debian jessy machine, but it already fails at: sage -i graphviz

================================ WARNING =================================
You are about to download and install an unmaintained experimental
package. This probably won't work at all for you! There is no guarantee
that it will build correctly, or behave as expected. Use at your own risk!

This package will be removed in future versions of SageMath. If you care
about this package, you should make a proper new-style package instead.
For more information about making Sage packages, see
http://doc.sagemath.org/html/en/developer/packaging.html
==========================================================================

I don't want to break sage, so I am wondering if there is a way to make sage use the system-wide installation of pygraphviz instead.

Preview: (hide)

Comments

I followed the instructions here: http://stackoverflow.com/questions/15... Now running the SMC docker with sage 7.5.1 locally, I installed pygraphviz both system wide and in sage-sh, with the result that I can run:

python
import pygraphviz

but if I run sage import pygraphviz

I get: ImportError: No module named pygraphviz

I really don't know what I am doing here and what I should do. Help!

stan gravatar imagestan ( 7 years ago )

1 Answer

Sort by » oldest newest most voted
1

answered 7 years ago

tmonteil gravatar image

The reason why this does not work is that Sage uses its own virtual environment, and does no uses system-wide python packages. Here is how to do, from the command line:

Install graphviz on your system:

apt install graphviz

Then install pygraphviz with Sage environment:

sage -pip install pygraphviz
Preview: (hide)
link

Comments

No way, that simple! Thank you!! Is sage -pip generally the correct way of installing packages in sage? I read somewhere about doing

sage -sh
pip install
stan gravatar imagestan ( 7 years ago )

It is the standard way to install pip-installable packages. Both methods are very similar. I prefer the sage -pip` since there is no subsheel so that i can use it within scripts.

tmonteil gravatar imagetmonteil ( 7 years ago )

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: 7 years ago

Seen: 711 times

Last updated: Apr 06 '17