0

I've found the solution:anaconda - graphviz - can't import after installation

I want to use graphviz and follow the commend in https://anaconda.org/anaconda/graphviz

run following in terminal

conda install -c anaconda graphviz

However no matter in Jupyter Notebook, python or Pycharm to import graphviz, it always shows

ModuleNotFoundError: No module named 'graphviz'

How to solve this problem? Thank you.

PS:

  1. when run which python in terminal: it return /opt/anaconda3/bin/python, therefore I use anaconda environment by default. And I have only one environment in anaconda that is root.

  2. when I run conda list in terminal, I can find this line :

graphviz 2.40.1 hefbbd9a_2

  1. I found a weird thing:

my pip and conda use the same environment:

run :which pip

get : /opt/anaconda3/bin/pip

run : which conda

get : /opt/anaconda3/bin/conda

However when I run pip list, I cannot find graphviz and many other packages which shows in conda list. For these packages show in conda list but not in pip list, I also cannot import them no matter in Jupyter notebook, python, pycharm etc. Why this happens?

maplemaple
  • 1,297
  • 6
  • 24
  • This usually happens when the virtual environment is not enabled properly or the PYTHONPATH does not contain the path to your installed packages. – JRajan Dec 02 '19 at 07:42

1 Answers1

0

After using "conda install attrs", other package installations are working fine without any http connection or ModuleNotFoundError errors. Please try and let me know.

  • Thank you. I've found the reason https://stackoverflow.com/questions/33433274/anaconda-graphviz-cant-import-after-installation – maplemaple Dec 02 '19 at 08:52