-
Notifications
You must be signed in to change notification settings - Fork 162
Graphviz executable not found due to space in path (returncode 1, and assertionError 1) #207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The error message at the top is GB2312 (Simplified Chinese) encoded and does indeed indicate some problem with the space character in
In English that would be:
So, some command was given as a full path, but not properly wrapped in quotes. Who did it? pydot says it did not do it, because it only called
I suspect that something inside the
I don't know the syntax there exactly, but it looks like it is not wrapping the command in double quotes. What to do next? Judging by the error message and the mentioned line numbers, you must have been using a pydot version around 1.3.0. It is also clear that you installed it through conda. The official pydot releases never contained the line Please report back if the latest versions still give you the same error indicating a problem with the space in |
A user of another Python package reported the issue in conda-forge/graphviz-feedstock#43 recently. Also had a space character in the command path. I posted a possible solution there. I think this issue here in pydot can be closed now. |
As mentioned in my previous comment, it seems that the root cause in this particular case (a space character in the Graphviz path) is with conda-forge/graphviz-feedstock#43 and should be solved there. To anyone here looking for a solution to Improvements to the way pydot handles Graphviz errors are discussed in #218 (currently closed, but will be reopened soon). |
Hi, my code is as below,
import pydot pydot.Dot.create(pydot.Dot())
the error is,
`
['dot.bat', '-Tps', 'C:\Users\Jry\AppData\Local\Temp\tmppcmwp3ua'] return code: 1
stdout, stderr:
b''
b"'D:\Program' \xb2\xbb\xca\xc7\xc4\xda\xb2\xbf\xbb\xf2\xcd\xe2\xb2\xbf\xc3\xfc\xc1\xee\xa3\xac\xd2\xb2\xb2\xbb\xca\xc7\xbf\xc9\xd4\xcb\xd0\xd0\xb5\xc4\xb3\xcc\xd0\xf2\r\n\xbb\xf2\xc5\xfa\xb4\xa6\xc0\xed\xce\xc4\xbc\xfe\xa1\xa3\r\n"
Traceback (most recent call last):
File "", line 1, in
File "D:\Program Files\Anaconda3\lib\site-packages\pydot.py", line 1886, in create
assert p.returncode == 0, p.returncode
AssertionError: 1
`
I read Pydot.py, found in line 1834, the code is,
prog += '.bat'
so I revise the line to
prog += '.exe'
then it works.
I use Anaconda, the installation path is D:\Program Files\Anaconda3.
the reason, I think, is the space in command path - 'Program Files' in dot.bat makes subprocess.Popen down.
So hope this can be solve in next version :-)
The text was updated successfully, but these errors were encountered: