Installing PygraphViz on Windows, Python 2.6

前端 未结 8 1240
轮回少年
轮回少年 2020-12-09 10:03

Anybody out there has successfully installed PygraphViz on Windows?

Since there is not an official release for Windows, I\'m trying to build it myself, but it fails

8条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-09 10:17

    This works for me, Python 2.7 32 bit, PyGraphViz 2.38, VCForPython27, Windows 10 64 bit.

    First, install VCForPython27, see http://aka.ms/vcpython27.

    Then, execute the following command, so that distutils.msvc9compiler can find the VC compiler. (This needs Administrator privilege. And if your Windows is 32 bit, you need to adjust the registry key.)

    reg add HKLM\SOFTWARE\WOW6432Node\Microsoft\VisualStudio\9.0\Setup\VC -v productdir -t REG_SZ -d "%LocalAppData%\Programs\Common\Microsoft\Visual C++ for Python\9.0" -f
    

    Finally, install PyGraphViz.

    set INCLUDE=C:\Program Files (x86)\Graphviz2.38\include
    set LIB=C:\Program Files (x86)\Graphviz2.38\lib\release\lib
    pip install pygraphviz
    

提交回复
热议问题