简体   繁体   中英

can't find graphviz module in azure notebook but says it's installed

I installed graphviz in my jupyter notebook (Azure studio). I know it is installed because when i try to install it again like this:

.{sys.executable} -m pip install graphviz

this is printed out:

Requirement already satisfied: graphviz in /anaconda/envs/azureml_py36/lib/python3.6/site-packages (0.14.1)

However, when I then try to import stuff from graphviz / use it / look for it:

!type graphviz

I get this:

graphviz: not found

I thought it might be a pathing problem but it doesn't seem to be:

print(sys.path) gives:

['/anaconda/envs/azureml_py36/lib/python36.zip',  
 '/anaconda/envs/azureml_py36/lib/python3.6',  
 '/anaconda/envs/azureml_py36/lib/python3.6/lib-dynload',   
 '',
 '/anaconda/envs/azureml_py36/lib/python3.6/site-packages',   
 '/anaconda/envs/azureml_py36/lib/python3.6/site-packages/xgboost-0.90-py3.6.egg',  
 '/anaconda/envs/azureml_py36/lib/python3.6/site-packages/IPython/extensions',  
 '/home/azureuser/.ipython',   
 '/anaconda/envs/azureml_py36/lib/python3.6/site-packages/azureml/_project/vendor']

Could somebody point me in the right direction? I am a little bit lost and have been trying to locate the issues for a while now...

With the command .{sys.executable} -m pip install graphviz you installed the python package graphiz .

You can use it in your python script by following the quickstart guide .

As you're trying the command !type graphviz it seems you want to have the graphviz binary though, not the python package.

The Graphviz download page has install instructions for different operating systems, eg:

sudo apt install graphviz

Alternatively you can install Graphviz via conda :

conda install -c anaconda graphviz

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM