Ask Your Question

Use system-wide installation of graphviz in sage?

asked 2017-04-06 03:13:45 -0500

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

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.

edit retag flag offensive close merge delete


I followed the instructions here: 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:

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 ( 2017-04-06 04:56:34 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2017-04-06 09:49:09 -0500

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
edit flag offensive delete link more


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 ( 2017-04-07 02:23:11 -0500 )edit

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 ( 2017-04-07 10:27:12 -0500 )edit

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: 2017-04-06 03:13:45 -0500

Seen: 46 times

Last updated: Apr 06