Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

anaconda - graphviz - can't import after installation

People also ask

How do I import graphviz?

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 .

Is graphviz included in Anaconda?

If you've installed Anaconda, all of the required packages will be included with the installer except for graphviz and pyarrow.


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).


On conda:

First install

conda install graphviz

Then the python-library for graphviz python-graphviz

gv_python is a dynamically loaded extension for python that provides access to the graph facilities of graphviz.

conda install python-graphviz

There is also pydot package, which can parse and dump into DOT language, used by GraphViz

conda install pydot

for me the problem was solved by installing another supportive package.

so I installed graphviz package through anaconda then I failed to import it

after that I installed a second package named python-graphviz also through anaconda

then I succeeded in importing graphviz module into my code

I hope this will help someone :)


You can actually install both packages at the same time. For me:

conda install -c anaconda graphviz python-graphviz

did the trick.


To install graphviz,

conda install -c anaconda graphviz
pip install graphviz

If conda command not found. Follow these:

export PATH=~/anaconda/bin:$PATH
conda --version # to check your conda version

Difference between conda and pip installation,
refer this stackoverflow answer