Siang Lim Posted February 7, 2022 Posted February 7, 2022 I'd like to install custom packages using apt-get (e.g. PyDot, which has GraphViz as a dependency https://graphviz.org/) but I don't know the datalab user password.
Administrators Teddy Posted February 9, 2022 Administrators Posted February 9, 2022 Siang, Looks like graphviz is available on pypi. I would try the following to install it. pip install graphviz You should not need the sudo command. Regards, Teddy
Siang Lim Posted February 9, 2022 Author Posted February 9, 2022 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
Administrators Teddy Posted February 9, 2022 Administrators Posted February 9, 2022 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.
Siang Lim Posted February 10, 2022 Author Posted February 10, 2022 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:
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now