简体   繁体   English

如何在 Windows64 上为 Python 3.5 安装 pydotplus

[英]How to install pydotplus for Python 3.5 on Windows64

What is a proven method for installing pydotplus for Python 3.5 on a 64-bit Windows(10) system?在 64 位 Windows(10) 系统上为 Python 3.5 安装 pydotplus 的行之有效的方法是什么? So far I haven't had any luck using conda or a number of other approaches.到目前为止,我还没有使用 conda 或其他一些方法运气好。

It appears there are several viable options for both Linux Ubuntu and Windows for Python 2.7.对于 Python 2.7,Linux Ubuntu 和 Windows 似乎都有几个可行的选择。 Unfortunately it's necessary for me to use this particular configuration, so any suggestions would be greatly appreciated!不幸的是,我有必要使用这个特定的配置,所以任何建议将不胜感激!

Try running anaconda prompt as 'administrator', then use:尝试以“管理员”身份运行 anaconda prompt,然后使用:

conda install -c conda-forge pydotplus conda install -c conda-forge pydotplus

What have you tried for conda?你为 conda 尝试了什么? According to https://anaconda.org/conda-forge/pydotplus/files pydotplus is available from conda-forge for Windows x64 and Python 3.5.根据https://anaconda.org/conda-forge/pydotplus/files ,可以从 conda-forge 获得适用于 Windows x64 和 Python 3.5 的 pydotplus。 Typing打字

conda install -c conda-forge pydotplus

should work.应该管用。

I had definitely tried that earlier but for some reason it wasn't working.我之前肯定尝试过,但由于某种原因它不起作用。 However, thanks to your response I took another look at my configuration to see why that particular install package wasn't running properly.但是,由于您的回复,我再次查看了我的配置,以了解为什么该特定安装包没有正常运行。

I originally used Anaconda to install a dual Python 2.7/3.5 environment and while I was always able to run 3.5 without any issues in an IDE (Jupyter Notebook in this instance), the current environment had still automatically defaulted to 2.7.我最初使用 Anaconda 安装双 Python 2.7/3.5 环境,虽然我总是能够在 IDE(在这种情况下为 Jupyter Notebook)中运行 3.5 没有任何问题,但当前环境仍然自动默认为 2.7。 The quick way to check for this via the command window is:通过命令窗口检查这一点的快速方法是:

C:\Users\Username\Anaconda\envs>conda env list

which should produce something like:这应该产生类似的东西:

# conda environments:
#
py27                   * C:\Users\Username\Anaconda\envs\py27
py35                     C:\Users\Username\Anaconda\envs\py35

Note that there will be '*' next to the environment that is currently active.请注意,当前处于活动状态的环境旁边会有“*”。 To switch, simply type 'activate' followed by the new desired environment name and the change should immediately be verified by the command prompt that is returned:要切换,只需键入“activate”,后跟新的所需环境名称,返回的命令提示符应立即验证更改:

C:\Users\Username\Anaconda\envs>activate py35

(py35) C:\Users\Username\Anaconda\envs>

After making the environment change, I reran the conda install package for pydotplus that you mentioned:更改环境后,我重新运行了您提到的 pydotplus 的 conda 安装包:

conda install -c conda-forge pydotplus

and it worked perfectly!它工作得很好!

Two other quick things to consider when installing pydotplus to ensure that it interacts correctly with GraphViz in your particular environment:安装 pydotplus 以确保它在您的特定环境中与 GraphViz 正确交互时要考虑的另外两个快速事项:

  1. Make sure you're running the most up to date version of scikit-learn.确保您运行的是最新版本的 scikit-learn。 More info is provided on the official website ( http://scikit-learn.org/stable/install.html ), including the quick update command: conda update scikit-learn官方网站( http://scikit-learn.org/stable/install.html )提供了更多信息,包括快速更新命令: conda update scikit-learn

  2. Verify that the GraphViz bin directory has been added to your User Path: ( Why is pydot unable to find GraphViz's executables in Windows 8? )验证 GraphViz bin 目录是否已添加到您的用户路径:( 为什么 pydot 在 Windows 8 中找不到 GraphViz 的可执行文件?

I had the same issue.我遇到过同样的问题。 here what I did was, first I ran the anaconda prompt as administrator and then give the command,在这里,我所做的是,首先我以管理员身份运行 anaconda 提示符,然后发出命令,

**conda install -c conda-forge pydotplus**

it worked for me well它对我很有效

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

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