Installing pydot and graphviz packages in Anaconda environment
Asked Answered
G

6

9

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

Gook answered 15/12, 2014 at 10:39 Comment(7)
Are you sure you can open those links in the browser?Spikenard
Also, have you tried with --allow-external?Spikenard
What do you mean? Indeed, it seems the TOKEN one is weird, but the others are ok.Gook
No, i have not tried that. What would be the correct full string?Gook
pip install --allow-external pydotSpikenard
Let us continue this discussion in chat.Gook
Possible duplicate of How can I use conda to install pydot?Mizuki
J
8

I had the same issue and solved it by (order is important):

  1. Installing graphviz, simply via sudo apt-get install graphviz
  2. Installing graphviz for Python via conda sudo ~/anaconda2/bin/conda install graphviz
  3. Finally, by installing pydot using conda sudo ~/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.

Jurkoic answered 20/6, 2016 at 9:39 Comment(0)
L
3

the problem is solved for me by installing

  1. pydot conda install -c anaconda pydot
  2. graphviz conda install -c conda-forge python-graphviz
Latinism answered 21/11, 2020 at 2:36 Comment(0)
E
2
pip install pydotplus
conda install -c anaconda graphviz=2.38.0

(see here for latest versions https://anaconda.org/anaconda/graphviz)

worked for me.

Efrenefron answered 19/4, 2017 at 11:11 Comment(0)
M
1

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.

Mizuki answered 18/9, 2017 at 0:50 Comment(0)
B
0

Just Installed it Please see if this works for you...

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:

Graphical Visualization of the Decision Tree

Bagehot answered 15/8, 2017 at 19:6 Comment(1)
Please use a comment if you're not sure. You can comment instead of answering after getting enough reputation. Yes, I know it's a bit of moment 22. :)Dundalk
J
0

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)

Jobholder answered 27/10, 2018 at 1:6 Comment(1)
Could you clarify what you mean by "after installing, imported pydotplus(instead of usual pydot)"?Intrusive

© 2022 - 2024 — McMap. All rights reserved.