anaconda - graphviz - can't import after installation

nivniv picture nivniv · Oct 30, 2015 · Viewed 99.8k times · Source

Just installed a package through anaconda (conda install graphviz), but ipython wouldn't find it.

I can see a graphviz folder in C:\Users\username\Anaconda\pkgs

But there's nothing in: C:\Users\username\Anaconda\Lib\site-packages

still wouldn't work

Answer

Wolfgang Ulmer picture Wolfgang Ulmer · Oct 30, 2015

The graphviz conda package is no Python package. It simply puts the graphviz files into your virtual env's Library/ directory. Look e.g. for dot.exe in the Library/bin/ directory.

To install the `graphviz` **Python package**, you can use `pip`: `conda install pip` and `pip install graphviz`. Always prefer conda packages if they are available over pip packages. Search for the package you need (`conda search pkgxy`) and then install it (`conda install pkgxy`). If it is not available, you can always build your own conda packages or you can try anaconda.org for user-built packages.

Update: There exists now a python-graphviz package at Anaconda.org which contains the Python interface for the graphviz tool. Simply install it with conda install python-graphviz.
(Thanks to wedran and g-kaklam for posting this solution and to endolith for notifying me).