简体   繁体   English

在 azure 笔记本中找不到 graphviz 模块,但说它已安装

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

I installed graphviz in my jupyter notebook (Azure studio).我在我的 jupyter 笔记本(Azure 工作室)中安装了 graphviz。 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:但是,当我尝试从 graphviz 导入东西/使用它/查找它时:

!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: print(sys.path)给出:

['/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 .使用命令.{sys.executable} -m pip install graphviz您安装了 python package graphiz

You can use it in your python script by following the quickstart guide .您可以按照快速入门指南在 python 脚本中使用它。

As you're trying the command !type graphviz it seems you want to have the graphviz binary though, not the python package.当您尝试命令!type graphviz时,您似乎想要使用 graphviz 二进制文件,而不是 python package。

The Graphviz download page has install instructions for different operating systems, eg: Graphviz 下载页面有针对不同操作系统的安装说明,例如:

sudo apt install graphviz

Alternatively you can install Graphviz via conda :或者,您可以通过 conda 安装 Graphviz

conda install -c anaconda graphviz

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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