Jump to content

How to install packages using apt-get?


Siang Lim

Recommended Posts

Hi Teddy,

Thanks for the suggestion. I tried that, but pip only installs the python interface to graphviz, and not the graphviz binaries itself needed to render the drawings.

From https://github.com/xflr6/graphviz:

Quote

To render the generated DOT source code, you also need to install Graphviz (download page, archived versions, installation procedure for Windows).

Sample graph from Stack Overflow: https://stackoverflow.com/questions/41942109/plotting-the-digraph-with-graphviz-in-python-from-dot-file

image.thumb.png.ab0b0acbe5e96f856408aeb266517e65.png

Link to comment
Share on other sites

  • Administrators

It looks like Graphviz can only be installed through an OS apt package which is not supported in Seeq Data Lab. I am guessing what is on PyPI is just a python wrapper.

You can try installing Graphviz on your local machine where you have access to make OS-level changes. Since you have a data lab license the SPy library will work for you on your local machine after you run the SPy.login command. You can run SPy from any python interpreter you would like if you are running it locally. 

There are a few things the local version can’t do that the data lab server can but for the most part, you won’t notice a difference.

Link to comment
Share on other sites

I figured out a solution!

Turns out that the conda package manager installs the binaries too, so we can try:

conda install graphviz

I ran into some issues with the jupyter/conda environments doing that, but the workaround was to:

1. Fire up a terminal

2. Fix the ~/.bashrc file with

conda init bash

3. Restart the terminal for the changes to take effect, then do 

conda install graphviz
4. That seemed to fix it. dot -V now works and we can pip install the Python interface and run it correctly without errors:

image.thumb.png.ec8319f4e255ea185847fa09d7107688.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...