在Windows 10上使用Python 3.6安装pygraphviz失败

时间:2017-08-06 14:54:36

标签: python python-3.x pip pygraphviz

环境:

  • Windows 10专业版

  • graphviz版本: dot - graphviz version 2.38.0(20140413.2041)

  • Python 3.6.2

错误输出:

PS E:\VSCode_workpalce> pip install pygraphviz
Collecting pygraphviz
  Using cached pygraphviz-1.3.1.zip
Installing collected packages: pygraphviz
  Running setup.py install for pygraphviz ... error
    Complete output from command e:\python\python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Maxwell\\AppData\\Local\\Temp\\pip-build-5yrqs95d\\pygraphviz\\setup
.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\Maxwell\AppData\Local\Temp\
pip-5b8cfh0_-record\install-record.txt --single-version-externally-managed --compile:
    running install
    include_dirs=None
    library_dirs=None
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.6
    creating build\lib.win-amd64-3.6\pygraphviz
    copying pygraphviz\agraph.py -> build\lib.win-amd64-3.6\pygraphviz
    copying pygraphviz\graphviz.py -> build\lib.win-amd64-3.6\pygraphviz
    copying pygraphviz\release.py -> build\lib.win-amd64-3.6\pygraphviz
    copying pygraphviz\version.py -> build\lib.win-amd64-3.6\pygraphviz
    copying pygraphviz\__init__.py -> build\lib.win-amd64-3.6\pygraphviz
    creating build\lib.win-amd64-3.6\pygraphviz\tests
    copying pygraphviz\tests\test.py -> build\lib.win-amd64-3.6\pygraphviz\tests
    copying pygraphviz\tests\test_attributes.py -> build\lib.win-amd64-3.6\pygraphviz\tests
    copying pygraphviz\tests\test_attribute_defaults.py -> build\lib.win-amd64-3.6\pygraphviz\tests
    copying pygraphviz\tests\test_clear.py -> build\lib.win-amd64-3.6\pygraphviz\tests
    copying pygraphviz\tests\test_drawing.py -> build\lib.win-amd64-3.6\pygraphviz\tests
    copying pygraphviz\tests\test_edge_attributes.py -> build\lib.win-amd64-3.6\pygraphviz\tests
    copying pygraphviz\tests\test_graph.py -> build\lib.win-amd64-3.6\pygraphviz\tests
    copying pygraphviz\tests\test_html.py -> build\lib.win-amd64-3.6\pygraphviz\tests
    copying pygraphviz\tests\test_layout.py -> build\lib.win-amd64-3.6\pygraphviz\tests
    copying pygraphviz\tests\test_node_attributes.py -> build\lib.win-amd64-3.6\pygraphviz\tests
    copying pygraphviz\tests\test_readwrite.py -> build\lib.win-amd64-3.6\pygraphviz\tests
    copying pygraphviz\tests\test_string.py -> build\lib.win-amd64-3.6\pygraphviz\tests
    copying pygraphviz\tests\test_subgraph.py -> build\lib.win-amd64-3.6\pygraphviz\tests
    copying pygraphviz\tests\test_unicode.py -> build\lib.win-amd64-3.6\pygraphviz\tests
    copying pygraphviz\tests\__init__.py -> build\lib.win-amd64-3.6\pygraphviz\tests
    running egg_info
    writing pygraphviz.egg-info\PKG-INFO
    writing dependency_links to pygraphviz.egg-info\dependency_links.txt
    writing top-level names to pygraphviz.egg-info\top_level.txt
    reading manifest file 'pygraphviz.egg-info\SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    warning: no previously-included files matching '*~' found anywhere in distribution
    warning: no previously-included files matching '*.pyc' found anywhere in distribution
    warning: no previously-included files matching '.svn' found anywhere in distribution
    no previously-included directories found matching 'doc\build'
    writing manifest file 'pygraphviz.egg-info\SOURCES.txt'
    copying pygraphviz\graphviz.i -> build\lib.win-amd64-3.6\pygraphviz
    copying pygraphviz\graphviz_wrap.c -> build\lib.win-amd64-3.6\pygraphviz
    running build_ext
    building 'pygraphviz._graphviz' extension
    creating build\temp.win-amd64-3.6
    creating build\temp.win-amd64-3.6\Release
    creating build\temp.win-amd64-3.6\Release\pygraphviz
    cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -INone -Ie:\python\python36\include -Ie:\python\python36\include /Tcpygraphviz/graphviz_wrap.c /Fobuild\temp.win-amd64-3.6\Release\pygraphvi
z/graphviz_wrap.obj
    error: command 'cl.exe' failed: No such file or directory

    ----------------------------------------
Command "e:\python\python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Maxwell\\AppData\\Local\\Temp\\pip-build-5yrqs95d\\pygraphviz\\setup.py';f=getattr(tokenize,
 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\Maxwell\AppData\Local\Temp\pip-5b8cfh0_-record\inst
all-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Maxwell\AppData\Local\Temp\pip-build-5yrqs95d\pygraphviz\

我在VS2017中安装了Python的VC编译器,可以手动找到cl.exe,但安装仍然失败。此外,我试图通过-c mingw32构建和安装它,它会产生更多的错误 如果有人有任何建议会很感激。

0 个答案:

没有答案