MyGrad icon indicating copy to clipboard operation
MyGrad copied to clipboard

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

Open rsokl opened this issue 4 years ago • 10 comments

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 avatar Jul 22 '20 15:07 rsokl

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

rsokl avatar Jul 22 '20 15:07 rsokl

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']

Nikhilkohli1 avatar Sep 10 '20 15:09 Nikhilkohli1

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?

rsokl avatar Sep 10 '20 15:09 rsokl

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

Nikhilkohli1 avatar Sep 10 '20 15:09 Nikhilkohli1

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

rsokl avatar Sep 10 '20 15:09 rsokl

Okay, Let me uninstall it and re-run this

Nikhilkohli1 avatar Sep 10 '20 15:09 Nikhilkohli1

That worked like a charm. Thanks a lot!

Nikhilkohli1 avatar Sep 10 '20 15:09 Nikhilkohli1

Awesome :) Hope you enjoy mygrad!

rsokl avatar Sep 10 '20 15:09 rsokl

@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

petarmhg avatar Sep 10 '20 15:09 petarmhg

(reopening because this is useful to reference)

rsokl avatar Sep 12 '20 14:09 rsokl