rsokl / MyGrad

Drop-in autodiff for NumPy.
https://mygrad.readthedocs.io
MIT License
193 stars 21 forks source link

hack / fix for dealing with graphviz .bat issue where space is in path #262

Open rsokl opened 4 years ago

rsokl commented 4 years ago

Find dot.bat file in env. E.g. at "C:\Users\Ryan S\.conda\envs\week3\Library\bin\dot.bat"

And edit it. The original file will contain

%~dp0.\graphviz\dot.exe %* 

Add quotes as so:

"%~dp0.\graphviz\dot.exe" %* 

and save - this should fix it

rsokl commented 4 years ago

Documented here: https://github.com/conda-forge/graphviz-feedstock/issues/43

Nikhilkohli1 commented 3 years ago

Hi, I am getting this error while running this. Can you please take a look?

CalledProcessError: Command '['dot', '-Tpng', '-O', 'simple_diagram']' returned non-zero exit status 1. [stderr: b'Format: "png" not recognized. Use one of:\r\n']

rsokl commented 3 years ago

I am not familiar with this issue, but it looks like your supported "devices" available in graphviz is empty. How did you install graphviz?

Perhaps this thread is relevant to you.

@petarmhg have you seen this?

Nikhilkohli1 commented 3 years ago

Okay, thanks for your quick response.

I installed graphviz in windows using below cmd -

conda install -c conda-forge graphviz xorg-libxrender xorg-libxpm pip install graphviz

I will check the threat provided by you. Thanks

rsokl commented 3 years ago

I think that there might be an issue with you installing graphviz twice - once with conda and once with pip. I suspect that your pip-installed graphviz is the culprit here.

It should be sufficient to run

conda install graphviz
conda install python-graphviz
Nikhilkohli1 commented 3 years ago

Okay, Let me uninstall it and re-run this

Nikhilkohli1 commented 3 years ago

That worked like a charm. Thanks a lot!

rsokl commented 3 years ago

Awesome :) Hope you enjoy mygrad!

petarmhg commented 3 years ago

@rsokl just for future reference: I believe you're right about the installing graphviz twice. conda install python-graphviz and pip install graphviz will install the same python bindings for graphviz, while conda install graphviz installs the graphviz software itself. Using both conda install graphviz and pip install graphviz (I assume) leads to some naming conflicts.

If using pip install graphviz to install the python bindings, then graphviz itself would need to be installed via one of these

rsokl commented 3 years ago

(reopening because this is useful to reference)