【发布时间】:2016-05-13 11:37:42
【问题描述】:
我使用 Ipython notebook 成功安装了pydot2。
%%bash
pip install pydot2
Collecting pydot2
Downloading pydot2-1.0.33.tar.gz
Requirement already satisfied (use --upgrade to upgrade): pyparsing in /Users/ram/anaconda/lib/python3.5/site-packages (from pydot2)
Requirement already satisfied (use --upgrade to upgrade): setuptools in /Users/ram/anaconda/lib/python3.5/site-packages/setuptools-19.1.1-py3.5.egg (from pydot2)
Building wheels for collected packages: pydot2
Running setup.py bdist_wheel for pydot2
Stored in directory: /Users/ram/Library/Caches/pip/wheels/e5/2d/ca/55e0109fb619edaa42ca287d9e55519eeebebc9bbca35996f6
Successfully built pydot2
Installing collected packages: pydot2
Successfully installed pydot2-1.0.33
在终端,我看到 pydot2 存在。在 python 中,import pydot2 失败,import pydot 显示 pydot 的 1.0.29 版本,而不是 1.0.33。
$ pip freeze| grep pydot
pydot2==1.0.33
$ python
Python 3.5.1 |Anaconda 2.4.0 (x86_64)| (default, Dec 7 2015, 11:24:55)
[GCC 4.2.1 (Apple Inc. build 5577)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
import pydot
pydot.__version__
'1.0.29'
import pydot2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'pydot2'
问题:在安装 pydot2 之前是否需要卸载 pydot。我该怎么做?
注意:我有一个双 Ananconda python env (2.7/3.5) 在 2.7 中,有 没有安装 pydot。我使用的是最新的 MacOS 10.11。
我无法确定 pydot 1.0.29 在我的系统上的位置。
【问题讨论】:
-
@DavidW,欢迎您的更改,并感谢您通知和纠正它。抱歉添加了错误的标签。