Graphviz 2.38
MSI 버전을 다운로드 하고 폴더 아래에 설치 C:\Python34
한 다음 실행 pip install Graphviz
하면 모든 것이 잘되었습니다. 시스템의 경로에을 추가했습니다 C:\Python34\bin
. 테스트 스크립트를 실행하려고 할 때 filename=dot.render(filename='test')
메시지가 나타납니다.
RuntimeError: failed to execute ['dot', '-Tpdf', '-O', 'test'], make sure the Graphviz executables are on your systems' path
"C:\Python34\bin\dot.exe"
시스템의 경로 를 설정하려고 시도했지만 작동하지 않았 "GRAPHVIZ_DOT"
으며 value가 있는 새로운 환경 변수 를 만들었지 만 "C:\Python34\bin\dot.exe"
여전히 작동하지 않습니다. Graphviz 및를 제거한 pip uninstall graphviz
다음 다시 설치하고 pip 설치를 다시 시도했지만 아무것도 작동하지 않습니다.
전체 역 추적 메시지는 다음과 같습니다.
Traceback (most recent call last):
File "C:\Python34\lib\site-packages\graphviz\files.py", line 220, in render
proc = subprocess.Popen(cmd, startupinfo=STARTUPINFO)
File "C:\Python34\lib\subprocess.py", line 859, in __init__
restore_signals, start_new_session)
File "C:\Python34\lib\subprocess.py", line 1112, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Documents\Kissmetrics\curves and lines\eventNodes.py", line 56, in <module>
filename=dot.render(filename='test')
File "C:\Python34\lib\site-packages\graphviz\files.py", line 225, in render
'are on your systems\' path' % cmd)
RuntimeError: failed to execute ['dot', '-Tpdf', '-O', 'test'], make sure the Graphviz executables are on your systems' path
아무도 그것에 대해 경험이 있습니까?
답변
import os
os.environ["PATH"] += os.pathsep + 'D:/Program Files (x86)/Graphviz2.38/bin/'
Windows에서는 처음에이 두 줄을 추가하면 ‘D : / Program Files (x86) /Graphviz2.38/bin/’ 이 bin 파일의 주소로 바뀝니다.
문제가 해결되었습니다.
답변
python 패키지뿐만 아니라 graphviz 패키지를 시스템에 설치해야합니다. 에 우분투 당신은 시도해야합니다 :
sudo apt-get install graphviz
답변
이것은 MAC의 문제를 해결했습니다 .
brew install graphviz
답변
Windows의 경우 :
- https://graphviz.gitlab.io/_pages/Download/Download_windows.html 에서 Windows 패키지를 설치 하십시오.
- 파이썬 설치
graphviz
패키지 C:\Program Files (x86)\Graphviz2.38\bin
사용자 경로에 추가C:\Program Files (x86)\Graphviz2.38\bin\dot.exe
시스템 경로에 추가
이것은 나를 위해 일했다!
답변
다음을 사용하십시오.
conda install python-graphviz
graphviz 실행 파일은을 사용하는 경우 conda 디렉토리와 다른 경로에 있습니다 pip install graphviz
.
답변
OSX Sierra, Python 2.7, Graphviz 2.38
pip install graphviz
및 conda install graphviz
BOTH를 사용 하면 문제가 해결됩니다.
pip
당신과 같은 경로 문제 conda
만 가져오고 가져 오기 오류 만 발생합니다.
답변
Windows 의 환경 변수 (시스템) PATH 에 아래를 추가 하십시오.
C : \ Program Files (x86) \ Graphviz2.38 \ bin
거기에서 .exe 파일을 찾을 수 있습니다
작동하지 않으면
python lib에 없는 프로그램 파일 에서 Graphviz2.38 / bin 폴더를 찾으십시오.
그런 다음 PATH에 추가하십시오.
.exe 파일이 존재하는 폴더를 찾는 것이 중요합니다
