Skip to content

Graphviz executable not found due to space in path (returncode 1, and assertionError 1) #207

Closed
@jryzj

Description

@jryzj

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 :-)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions