简体   繁体   English

如何使用conda安装pydotplus

[英]How can I use conda to install pydotplus

I execute the code following on my machine( Win10, python 2.7, Anaconda&Spyder) and meet ImportError: No module named pydotplus . 我在我的机器上执行以下代码(Win10,python 2.7,Anaconda和Spyder)并遇到ImportError: No module named pydotplus

import networkx as nx
from networkx.drawing.nx_pydot import write_dot
G = nx.DiGraph([(1,2),(2,3),(3,2)])
write_dot(G,'file.dot')

It clearly that I should install pydotplus package. 很明显我应该安装pydotplus包。 I try to conda install pydotplus directly but says Error: Package missing in current win-64 channels . 我尝试直接conda install pydotplus ,但Error: Package missing in current win-64 channelsError: Package missing in current win-64 channels Then, I google it but find there is no information about how to install it on conda. 然后,我谷歌它但发现没有关于如何在conda上安装它的信息。 By the way, I have install pydot on conda before. 顺便说一句,我之前在pydot上安装了pydot

Thanks for you help in advance! 感谢您提前帮助!

  • Using conda install command below worked for me (globally installed): 使用下面的conda install命令对我conda install (全局安装):

conda install -c conda-forge pydotplus

  • Using Anaconda environments (per environment instance) you can install pydotplus using pip : 使用Anaconda环境(每个环境实例),您可以使用pip安装pydotplus

pip install pydotplus

I would personally recommend using the Anaconda environments to install your packages for a given solution as its a more modular and cleaner way of building solutions with Anaconda. 我个人建议使用Anaconda环境来安装给定解决方案的软件包,因为它是一种更模块化,更清洁的方式来构建Anaconda的解决方案。

Installing via Anaconda environments referenced from answer on Quora , see: https://www.quora.com/How-do-I-install-Python-packages-in-Anaconda 通过Quora答案引用的Anaconda环境安装,请参阅: https//www.quora.com/How-do-I-install-Python-packages-in-Anaconda

I tried conda install pydotplus , but it failed. 我试过conda install pydotplus ,但是失败了。

Then tried python -m pip install pydotplus and it worked. 然后尝试了python -m pip install pydotplus并且它工作正常。

Try 尝试

pip install pydotplus

if it isn't part of the conda universe. 如果它不是conda宇宙的一部分。

打开Anaconda提示:

pip install pydotplus

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

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