“dot.exe” not found in path. Pydot on Python (Windows 7)

前端 未结 8 1493
挽巷
挽巷 2021-01-31 10:04

I\'m having trouble running Python\'s pydot on Windows 7.

I installed pydot with: conda install -c rmg pydot=1.2.2

I have graphviz installed under

相关标签:
8条回答
  • 2021-01-31 10:10

    Other solutions didn't work for me, and I figured out pydot tried to run a hardcoded dot.bat so I just created dot.bat wrapper nearby dot.exe and it worked:

    @echo off
    dot %*
    
    0 讨论(0)
  • 2021-01-31 10:14

    Using django-extensions to generate the model graph for your Django application, I did this and it worked:

    pip install django-extensions
    pip install pyparsing
    pip install graphviz
    pip install pydot
    conda install graphviz
    

    Add django-extensions to you INSTALLED_APPS and then add C:\Program Files\Anaconda3\pkgs\graphviz-2.38.0-4\Library\bin\graphviz to my system path variable. Then finally and normally:

    python manage.py graph_models -a -g -o pic.png
    
    0 讨论(0)
  • 2021-01-31 10:16

    Type conda install pydot graphviz in cmd, and then add the executables location directory C:\Anaconda3\pkgs\graphviz-2.38-hfd603c8_2\Library\bin\graphviz to your system path variable. That works!

    0 讨论(0)
  • 2021-01-31 10:16

    On Ubuntu 18.04 installing the binaries with sudo apt-get install graphviz led to dot being placed under /usr/bin/dot (it might go to /usr/local/bin/dot per their installation guide). After doing:

    pip3 install pydot-ng
    

    and adding the following lines (similar to @Ernest's answer in Linux) to the script it worked:

    import os
    os.environ["PATH"] += os.pathsep + "/usr/bin/dot"
    
    0 讨论(0)
  • 2021-01-31 10:28

    I followed the instructions given in this blog.

    Then I installed graphviz from here and added C:\Program Files (x86)\Graphviz2.38\bin to PATH.

    Next I did:

    conda install pydot-ng 
    

    And finally in my notebook I added the two lines below.

    import os
    os.environ["PATH"] += os.pathsep + 'C:/Program Files (x86)/Graphviz2.38/bin/'
    
    0 讨论(0)
  • 2021-01-31 10:32

    I was having trouble with this and found out that if you're using the Visual Studio Code integrated command line then you should make sure to restart Visual Studio Code (you might need to only restart the command line) otherwise the PATH changes won't take place...

    0 讨论(0)
提交回复
热议问题