distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools
时间: 2023-10-17 19:34:50 浏览: 190
这个错误通常意味着缺少 Microsoft Visual C++ 14.0 或更高版本。你可以通过安装 "Microsoft C++ Build Tools" 来获取它。以下是解决此错误的一些步骤:
1. 首先,确保你有合适的 Visual Studio 版本。你可以从以下链接下载和安装 Visual Studio Community Edition:https://visualstudio.microsoft.com/downloads/
2. 安装 Visual Studio 后,打开 Visual Studio Installer,选择 "修改" 或 "修改"。
3. 在弹出的对话框中,选择 "单个组件" 选项卡,并找到 "C++工具"。
4. 在 "C++工具" 下选择 "MSVC v142 - VS 2019 C++ x64/x86 build tools"(可能是其他类似名称)并确保选中。
5. 单击右下角的 "修改" 按钮,开始安装所需的组件。
6. 安装完成后,重新启动计算机并尝试运行你的程序。
希望这些步骤能够解决你的问题。如果还有其他疑问,请随时提问。
相关问题
Building wheels for collected packages: cython_bbox Building wheel for cython_bbox (setup.py) ... error error: subprocess-exited-with-error × python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [5 lines of output] running bdist_wheel running build running build_ext building 'cython_bbox' 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 cython_bbox Running setup.py clean for cython_bbox Failed to build cython_bbox Installing collected packages: cython_bbox Running setup.py install for cython_bbox ... error error: subprocess-exited-with-error × Running setup.py install for cython_bbox did not run successfully. │ exit code: 1 ╰─> [18 lines of output] running install D:\python\envs\yolov578\lib\site-packages\setuptools\_distutils\cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated. !! ******************************************************************************** Please avoid running ``setup.py`` directly. Instead, use pypa/build, pypa/installer, pypa/build or other standards-based tools. See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details. ******************************************************************************** !! self.initialize_options() running build running build_ext building 'cython_bbox' 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. ╰─> cython_bbox note: This is an issue with the package mentioned above, not pip. hint: See above for output from the failure.
这个错误提示是由于安装cython_bbox时缺少Microsoft Visual C++ 14.0或更高版本,你需要安装该工具才能成功构建cython_bbox。你可以通过以下链接下载并安装Microsoft C++ Build Tools:https://visualstudio.microsoft.com/visual-cpp-build-tools/。安装完成后,再次尝试安装cython_bbox即可。另外,提示中还提到了一些关于setup.py install的警告信息,建议使用其他标准工具来代替直接运行setup.py install。
解释:C compiler: Traceback (most recent call last): File "D:\dev\python\python3.11.4\Lib\site-packages\setuptools\msvc.py", line 173, in _msvc14_get_vc_env out = subprocess.check_output( ^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\dev\python\python3.11.4\Lib\subprocess.py", line 466, in check_output return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\dev\python\python3.11.4\Lib\subprocess.py", line 571, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command 'cmd /u /c "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64 && set' returned non-zero exit status 255. The above exception was the direct cause of the following exception: Traceback (most recent call last): File "D:\dev\python\python3.11.4\Lib\site-packages\mdtraj-1.9.4\setup.py", line 56, in <module> compiler.initialize() File "D:\dev\python\python3.11.4\Lib\site-packages\mdtraj-1.9.4\basesetup.py", line 45, in initialize self._print_compiler_version(cc) File "D:\dev\python\python3.11.4\Lib\site-packages\mdtraj-1.9.4\basesetup.py", line 89, in _print_compiler_version cc.initialize() File "D:\dev\python\python3.11.4\Lib\site-packages\setuptools\_distutils\_msvccompiler.py", line 253, in initialize vc_env = _get_vc_env(plat_spec) ^^^^^^^^^^^^^^^^^^^^^^ File "D:\dev\python\python3.11.4\Lib\site-packages\setuptools\msvc.py", line 214, in msvc14_get_vc_env return _msvc14_get_vc_env(plat_spec) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\dev\python\python3.11.4\Lib\site-packages\setuptools\msvc.py", line 178, in _msvc14_get_vc_env raise distutils.errors.DistutilsPlatformError( distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools
这是一个错误消息,说明在编译某个程序时出现了问题。具体来说,这个错误是由于缺少 Microsoft Visual C++ 14.0 或更高版本所导致的。
要解决这个问题,你需要安装 Microsoft Visual C++ 14.0 或更高版本。你可以通过以下步骤解决:
1. 访问链接:https://visualstudio.microsoft.com/visual-cpp-build-tools
2. 在网页上下载并安装 "Microsoft C++ Build Tools"。
3. 安装完成后,重新运行你的代码或程序,应该就能正常编译了。
请注意,根据你的具体环境和编译需求,可能需要安装其他依赖项或进行其他配置。如果问题仍然存在,你可以查看相关文档或寻求帮助来解决特定的编译问题。
阅读全文