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:
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 isroot
.when I run
conda list
in terminal, I can find this line :
graphviz 2.40.1 hefbbd9a_2
- 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?