I want to be able to create graphical decision trees in Python, and I am currently trying to install both pydot
and graphviz
.
I am using Anaconda as my environment (along with Spyder), and have tried to run the following lines of code
conda install -c https://conda.binstar.org/t/TOKEN/j14r pydot
with the result
Error: unknown host: http://repo.continuum.io/pkgs/pro/win-32/
Error: unknown host: http://repo.continuum.io/pkgs/free/win-32/
Error: unknown host: https://conda.binstar.org/t/TOKEN/j14r/win-32/
Error: No packages found matching: pydot
I have also tried using pip install pydot
and pip install graphviz
with similar results:
Downloading/unpacking pydot
Cannot fetch index base URL https://pypi.python.org/simple/
Could not find any downloads that satisfy the requirement pydot
Cleaning up...
No distributions at all found for pydot
Storing complete log in [...]
I am getting pretty bored at trying to figure out how to go about this, so I was hoping anyone out there could give me some tips perhaps.
Thanks
I had the same issue and solved it by (order is important):
- Installing
graphviz
, simply viasudo apt-get install graphviz
- Installing
graphviz
for Python via condasudo ~/anaconda2/bin/conda install graphviz
- Finally, by installing
pydot
using condasudo ~/anaconda2/bin/conda install pydot
This answer is overdue but this post helped me (together with this one that mentions the installation order), so hopefully this answer will help someone else. I'm using Ubuntu 14.04 and Python 2.7.
P.S. apparently, there could be some issues with step 1 of the above algorithm, this post mentions how to fix them.
pip install pydot
should now install version 1.2.3 from PyPI. Since the time of the OP, a distribution for pydot
has been uploaded to PyPI.
pip install pydotplus
conda install -c anaconda graphviz=2.38.0
(see here for latest versions https://anaconda.org/anaconda/graphviz)
worked for me.
1) Open the "Anaconda Prompt" by simply pressing WINDOW + S (for Windows OS Users) and type CMD. Then Select accordingly.
2) Type the command "pip install pydot"
3) Follow the onscreen information.
NOTE: I'm using Conda version 4.3.21 and Python 3.6
And Decision Tree Implementation below:
installing graphviz first and then installing pydotplus on mac, helped me. I was not able to install pydot through pip or conda or even through jupiter notebook. after installing, imported pydotplus(instead of usual pydot)
来源:https://stackoverflow.com/questions/27482170/installing-pydot-and-graphviz-packages-in-anaconda-environment