2017-07-31 75 views
0

我一直在使用pip爲Windows安裝pygraphviz的問題。 Python 2.7工作正常,我已經做了其他安裝使用PIP沒有錯誤。我已經安裝graphviz。pygraphviz失敗的建築輪子

當執行pip install pygraphviz我得到以下輸出:

Collecting pygraphviz 
    Using cached pygraphviz-1.3.1.zip 
Building wheels for collected packages: pygraphviz 
    Running setup.py bdist_wheel for pygraphviz ... error 
    Complete output from command c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\cnh004\\appdata\\local\\temp\\pip-build-onw9wy\\pygraphviz\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d c:\users\cnh004\appdata\local\temp\tmpcdsmtypip-wheel- --python-tag cp27: 
    running bdist_wheel 
    running build 
    running build_py 
    creating build 
    creating build\lib.win32-2.7 
    creating build\lib.win32-2.7\pygraphviz 
    copying pygraphviz\agraph.py -> build\lib.win32-2.7\pygraphviz 
    copying pygraphviz\graphviz.py -> build\lib.win32-2.7\pygraphviz 
    copying pygraphviz\release.py -> build\lib.win32-2.7\pygraphviz 
    copying pygraphviz\version.py -> build\lib.win32-2.7\pygraphviz 
    copying pygraphviz\__init__.py -> build\lib.win32-2.7\pygraphviz 
    creating build\lib.win32-2.7\pygraphviz\tests 
    copying pygraphviz\tests\test.py -> build\lib.win32-2.7\pygraphviz\tests 
    copying pygraphviz\tests\test_attributes.py -> build\lib.win32-2.7\pygraphviz\tests 
    copying pygraphviz\tests\test_attribute_defaults.py -> build\lib.win32-2.7\pygraphviz\tests 
    copying pygraphviz\tests\test_clear.py -> build\lib.win32-2.7\pygraphviz\tests 
    copying pygraphviz\tests\test_drawing.py -> build\lib.win32-2.7\pygraphviz\tests 
    copying pygraphviz\tests\test_edge_attributes.py -> build\lib.win32-2.7\pygraphviz\tests 
    copying pygraphviz\tests\test_graph.py -> build\lib.win32-2.7\pygraphviz\tests 
    copying pygraphviz\tests\test_html.py -> build\lib.win32-2.7\pygraphviz\tests 
    copying pygraphviz\tests\test_layout.py -> build\lib.win32-2.7\pygraphviz\tests 
    copying pygraphviz\tests\test_node_attributes.py -> build\lib.win32-2.7\pygraphviz\tests 
    copying pygraphviz\tests\test_readwrite.py -> build\lib.win32-2.7\pygraphviz\tests 
    copying pygraphviz\tests\test_string.py -> build\lib.win32-2.7\pygraphviz\tests 
    copying pygraphviz\tests\test_subgraph.py -> build\lib.win32-2.7\pygraphviz\tests 
    copying pygraphviz\tests\test_unicode.py -> build\lib.win32-2.7\pygraphviz\tests 
    copying pygraphviz\tests\__init__.py -> build\lib.win32-2.7\pygraphviz\tests 
    running egg_info 
    writing pygraphviz.egg-info\PKG-INFO 
    writing top-level names to pygraphviz.egg-info\top_level.txt 
    writing dependency_links to pygraphviz.egg-info\dependency_links.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.win32-2.7\pygraphviz 
    copying pygraphviz\graphviz_wrap.c -> build\lib.win32-2.7\pygraphviz 
    running build_ext 
    building 'pygraphviz._graphviz' extension 
    error: Microsoft Visual C++ 9.0 is required. Get it from http://aka.ms/vcpython27 

    ---------------------------------------- 
    Failed building wheel for pygraphviz 
    Running setup.py clean for pygraphviz 
Failed to build pygraphviz 
Installing collected packages: pygraphviz 
    Running setup.py install for pygraphviz ... error 
    Complete output from command c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\cnh004\\appdata\\local\\temp\\pip-build-onw9wy\\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\cnh004\appdata\local\temp\pip-wa7pph-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.win32-2.7 
    creating build\lib.win32-2.7\pygraphviz 
    copying pygraphviz\agraph.py -> build\lib.win32-2.7\pygraphviz 
    copying pygraphviz\graphviz.py -> build\lib.win32-2.7\pygraphviz 
    copying pygraphviz\release.py -> build\lib.win32-2.7\pygraphviz 
    copying pygraphviz\version.py -> build\lib.win32-2.7\pygraphviz 
    copying pygraphviz\__init__.py -> build\lib.win32-2.7\pygraphviz 
    creating build\lib.win32-2.7\pygraphviz\tests 
    copying pygraphviz\tests\test.py -> build\lib.win32-2.7\pygraphviz\tests 
    copying pygraphviz\tests\test_attributes.py -> build\lib.win32-2.7\pygraphviz\tests 
    copying pygraphviz\tests\test_attribute_defaults.py -> build\lib.win32-2.7\pygraphviz\tests 
    copying pygraphviz\tests\test_clear.py -> build\lib.win32-2.7\pygraphviz\tests 
    copying pygraphviz\tests\test_drawing.py -> build\lib.win32-2.7\pygraphviz\tests 
    copying pygraphviz\tests\test_edge_attributes.py -> build\lib.win32-2.7\pygraphviz\tests 
    copying pygraphviz\tests\test_graph.py -> build\lib.win32-2.7\pygraphviz\tests 
    copying pygraphviz\tests\test_html.py -> build\lib.win32-2.7\pygraphviz\tests 
    copying pygraphviz\tests\test_layout.py -> build\lib.win32-2.7\pygraphviz\tests 
    copying pygraphviz\tests\test_node_attributes.py -> build\lib.win32-2.7\pygraphviz\tests 
    copying pygraphviz\tests\test_readwrite.py -> build\lib.win32-2.7\pygraphviz\tests 
    copying pygraphviz\tests\test_string.py -> build\lib.win32-2.7\pygraphviz\tests 
    copying pygraphviz\tests\test_subgraph.py -> build\lib.win32-2.7\pygraphviz\tests 
    copying pygraphviz\tests\test_unicode.py -> build\lib.win32-2.7\pygraphviz\tests 
    copying pygraphviz\tests\__init__.py -> build\lib.win32-2.7\pygraphviz\tests 
    running egg_info 
    writing pygraphviz.egg-info\PKG-INFO 
    writing top-level names to pygraphviz.egg-info\top_level.txt 
    writing dependency_links to pygraphviz.egg-info\dependency_links.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.win32-2.7\pygraphviz 
    copying pygraphviz\graphviz_wrap.c -> build\lib.win32-2.7\pygraphviz 
    running build_ext 
    building 'pygraphviz._graphviz' extension 
    error: Microsoft Visual C++ 9.0 is required. Get it from http://aka.ms/vcpython27 

    ---------------------------------------- 
Command "c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\cnh004\\appdata\\local\\temp\\pip-build-onw9wy\\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\cnh004\appdata\local\temp\pip-wa7pph-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\cnh004\appdata\local\temp\pip-build-onw9wy\pygraphviz\ 

我也看了看solution given for Mac,但是當我試圖爲建議安裝cgraph,它再次表示Failed building wheel for cgraph。如果有人有任何建議,將不勝感激。謝謝。

回答