安装 Polygon 报错需要依赖 Microsoft Visual C++ 14.0
使用 pip 安装 Polygon 报错,需要 Microsoft Visual C++ 14 或者是 Microsoft Visual C++ Build Tools 构建工具:
Building wheels for collected packages: Polygon3
Building wheel for Polygon3 (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\dell\anaconda3\envs\tfenv\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\dell\\AppData\\Local\\Temp\\pip-install-mznbfad2\\polygon3_cee40c7ea0c6484b9af12f81b433d085\\setup.py'"'"'; __file__='"'"'C:\\Users\\dell\\AppData\\Local\\Temp\\pip-install-mznbfad2\\polygon3_cee40c7ea0c6484b9af12f81b433d085\\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'"'"'))' bdist_wheel -d 'C:\Users\dell\AppData\Local\Temp\pip-wheel-4pl5gmvp'
cwd: C:\Users\dell\AppData\Local\Temp\pip-install-mznbfad2\polygon3_cee40c7ea0c6484b9af12f81b433d085\
Complete output (14 lines):
NumPy extension not found - disabling support for it!
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.6
creating build\lib.win-amd64-3.6\Polygon
copying Polygon\IO.py -> build\lib.win-amd64-3.6\Polygon
copying Polygon\Shapes.py -> build\lib.win-amd64-3.6\Polygon
copying Polygon\Utils.py -> build\lib.win-amd64-3.6\Polygon
copying Polygon\__init__.py -> build\lib.win-amd64-3.6\Polygon
running build_ext
building 'Polygon.cPolygon' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
----------------------------------------
ERROR: Failed building wheel for Polygon3
Running setup.py clean for Polygon3
Failed to build Polygon3
我以为就是安装了这两个中的一个就能解决,结果是 Build Tools 安装了依旧提示这个错误,而 Microsoft Visual C++ 14 无法安装,提示错误是你已经安装另外一个版本。
无奈只能去晚上找找 whl 安装包了,大多数推荐的是 https://www.lfd.uci.edu/~gohlke/pythonlibs/ 这个地址,但是我访问的时候已经不行了,最后在华为的镜像站里面找到了下载地址:https://mirrors.huaweicloud.com/repository/pypi/simple/polygon3/。
下载自己需要的版本,这里 cp36 代表 python 版本 3.6,win_amd64 代表 win 64 位。使用下面的命令开始安装:
pip install Polygon3-3.0.8-cp38-cp38-win_amd64.whl
如果提示错误,大概率是没有使用管理员权限运行 cmd。
延伸阅读:
暂无内容!
评论列表 (0条):
加载更多评论 Loading...