首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >安装pygraphviz时有问题

安装pygraphviz时有问题
EN

Stack Overflow用户
提问于 2022-04-12 15:25:19
回答 1查看 427关注 0票数 1

当试图通过pygraphviz安装pip时,我遇到了一个问题。这花了很长时间,但我成功地安装了graphviz

代码语言:javascript
复制
(base) C:\Users\>pip install graphviz --upgrade
Requirement already satisfied: graphviz in c:\programdata\anaconda3\lib\site-packages (0.19.2)

我使用的是Python 3.9.7,操作系统是Windows10。当我使用Anaconda提示符并输入pip install pygraphviz时,我会收到以下错误。

代码语言:javascript
复制
Installing collected packages: pygraphviz
    Running setup.py install for pygraphviz ... error
    ERROR: Command errored out with exit status 1:
     command: 'C:\ProgramData\Anaconda3\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users \\AppData\\Local\\Temp\\pip-install-krs5aqg9\\pygraphviz_28eebe5841e1478493b04aa9e79a4fcb\\setup.py'"'"'; __file__='"'"'C:\\Users \\AppData\\Local\\Temp\\pip-install-krs5aqg9\\pygraphviz_28eebe5841e1478493b04aa9e79a4fcb\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users \AppData\Local\Temp\pip-record-qvuual1u\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\ProgramData\Anaconda3\Include\pygraphviz'
         cwd: C:\Users \AppData\Local\Temp\pip-install-krs5aqg9\pygraphviz_28eebe5841e1478493b04aa9e79a4fcb\
    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 files found matching '*.png' under directory 'doc'
    warning: no files found matching '*.txt' under directory 'doc'
    warning: no files found matching '*.css' under directory 'doc'
    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'
    adding license file 'LICENSE'
    writing manifest file 'pygraphviz.egg-info\SOURCES.txt'
    copying pygraphviz\graphviz.i -> build\lib.win-amd64-3.9\pygraphviz
    copying pygraphviz\graphviz_wrap.c -> build\lib.win-amd64-3.9\pygraphviz
    running build_ext
    building 'pygraphviz._graphviz' extension
    error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\ProgramData\Anaconda3\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\ \\AppData\\Local\\Temp\\pip-install-krs5aqg9\\pygraphviz_28eebe5841e1478493b04aa9e79a4fcb\\setup.py'"'"'; __file__='"'"'C:\\Users \\AppData\\Local\\Temp\\pip-install-krs5aqg9\\pygraphviz_28eebe5841e1478493b04aa9e79a4fcb\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users \AppData\Local\Temp\pip-record-qvuual1u\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\ProgramData\Anaconda3\Include\pygraphviz' Check the logs for full command output.

唯一有意义的错误是Microsoft Visual C++ 14.0 or greater is required.,但我已经安装了最新版本。

EN

回答 1

Stack Overflow用户

发布于 2022-12-02 08:28:01

尝试从Anaconda环境安装:

conda install -c conda-forge python-graphviz

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/71845331

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档