如何解决pyResMan安装时的pyGlobalPlatform编译报错问题?
问题
执行命令C:\Users>pip install pyResMan安装pyResMan时,依赖包pyGlobalPlatform构建失败,核心错误提示需安装Microsoft Visual C++ 14.0或更高版本。完整错误日志如下:
Collecting pyResMan Using cached pyResMan-5.0.2-py2.py3-none-any.whl Requirement already satisfied: peppercorn in d:\program files\python39\lib\site-packages (from pyResMan) (0.6) Collecting pyGlobalPlatform Using cached pyGlobalPlatform-1.4.16.zip (18 kB) Preparing metadata (setup.py) ... done Requirement already satisfied: pyscard in d:\program files\python39\lib\site-packages (from pyResMan) (2.0.3) Building wheels for collected packages: pyGlobalPlatform Building wheel for pyGlobalPlatform (setup.py) ... error error: subprocess-exited-with-error × python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [11 lines of output] running bdist_wheel running build running build_py creating build creating build\lib.win-amd64-cpython-39 creating build\lib.win-amd64-cpython-39\pyGlobalPlatform copying pyGlobalPlatform\globalplatformlib.py -> build\lib.win-amd64-cpython-39\pyGlobalPlatform copying pyGlobalPlatform\__init__.py -> build\lib.win-amd64-cpython-39\pyGlobalPlatform running build_ext building 'pyGlobalPlatform.pyGlobalPlatform' 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/ [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for pyGlobalPlatform Running setup.py clean for pyGlobalPlatform Failed to build pyGlobalPlatform Installing collected packages: pyGlobalPlatform, pyResMan Running setup.py install for pyGlobalPlatform ... error error: subprocess-exited-with-error × Running setup.py install for pyGlobalPlatform did not run successfully. │ exit code: 1 ╰─> [13 lines of output] running install D:\Program Files\Python39\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. warnings.warn( running build running build_py creating build creating build\lib.win-amd64-cpython-39 creating build\lib.win-amd64-cpython-39\pyGlobalPlatform copying pyGlobalPlatform\globalplatformlib.py -> build\lib.win-amd64-cpython-39\pyGlobalPlatform copying pyGlobalPlatform\__init__.py -> build\lib.win-amd64-cpython-39\pyGlobalPlatform running build_ext building 'pyGlobalPlatform.pyGlobalPlatform' 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/ [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: legacy-install-failure × Encountered error while trying to install package. ╰─> pyGlobalPlatform note: This is an issue with the package mentioned above, not pip. hint: See above for output from the failure.
解决办法
方法一:安装C++编译工具链
- 下载并运行Microsoft C++ Build Tools安装程序
- 在安装界面勾选**Desktop development with C++**组件(包含VC++14.0及以上版本的编译工具)
- 完成安装后重启命令提示符/终端,重新执行
pip install pyResMan
方法二:使用预编译wheel包(无需编译)
- 找到匹配你Python版本(3.9)和系统架构(amd64)的
pyGlobalPlatform预编译wheel文件 - 执行
pip install [wheel文件名]安装该包 - 安装完成后再执行
pip install pyResMan
内容的提问来源于stack exchange,提问作者arif shahmim
相关产品推荐
相关产品推荐

