【问题标题】:Failed to run MSBuild command on pip无法在 pip 上运行 MSBuild 命令
【发布时间】:2022-03-04 09:41:35
【问题描述】:

我正在 Python 中安装 scikit-survival 包。当我跑步时

pip install scikit-survival 

我在 msbuild 上遇到错误,我将感兴趣的元素附在下面:


PS C:\WINDOWS\system32> pip install scikit-survival     
                                                              
..
Building wheels for collected packages: qdldl                                                                             
Building wheel for qdldl (setup.py) ... error                                                                           
error: subprocess-exited-with-error                                                                                                                                                                                                             
× python setup.py bdist_wheel did not run successfully.                                                                 
│ exit code: 1                                                                                                          
╰─> [24 lines of output]                                                                                                    
running bdist_wheel                                                                                                     
running build                                                                                                           
running build_ext                                                                                                       
-- Selecting Windows SDK version  to target Windows 10.0.22000.                                                         
CMake Error at CMakeLists.txt:4 (project):                                                                                
Failed to run MSBuild command:                                                                                                                                                                                                                    
MSBuild.exe                                                                                                                                                                                                                                   
to get the value of VCTargetsPath:                                                                                                                                                                                                                
Impossibile trovare il file specification                                                                                                                                                                                                                                                                                                                                                                                                                                                     
-- Configuring incomplete, errors occurred!                                                                             
See also "C:/Users/xyz/AppData/Local/Temp/pip-install-
uyja9anj/qdldl_c05b02902dbe43b69e2860ddcf14a11a/c/build/CMakeFiles/CMak
eOutput.log".                                                                                                  
Impossibile trovare il file specification                                                                                 
CMake Error: Generator: execution of make failed. Make command was: 
MSBuild.exe qdldlamd.vcxproj /p:Configuration=Release /p:Platform=x64 
/p:VisualStudioVersion=14.0 /v:m &&                                                                   
building 'qdldl' extension                                                                                              
cl : warning della riga di comando D9002 : l'opzione sconosciuta '-
std=c++11' verr… ignorata                            qdldl.cpp                                                                                                               
c\qdldl/include/qdldl.h(5): fatal error C1083: Non Š possibile aprire 
il file inclusione: 'qdldl_types.h': No such file or directory                                                                                                            
error: command 'C:\\Program Files (x86)\\Microsoft Visual 
Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.30.30705\\bin\\HostX86\\x
64\\cl.exe' failed with exit code 2                                                                            
[end of output]                                                                                                                                                                                                                             
...                

问题在于 MSbuild.exe。你知道怎么解决吗?我已经安装了带有 Python 扩展的 Visual Studio Community 和 Visual Studio Build Tools。

【问题讨论】:

  • 您可以为 scikit-survival 或 qldl 创建错误报告,因为那是构建失败的地方。一个可能更简单的解决方案:使用 conda 安装 scikit-survival,请参阅 scikit-survival.readthedocs.io/en/stable/index.html
  • 感谢您的建议。我想避免康达。我会尝试询问 scikit-survival 或 qldl。

标签: python-3.x visual-studio msbuild build-tools scikit-survival


【解决方案1】:

尝试:

pip install pipwin
pipwin install <package>

【讨论】:

    【解决方案2】:

    您似乎使用了VisualStudio 版本错误。如Make命令错误中提到的VisualStudioVersion应该是14.0(即Visual Studio 2015),你的Visual Studio版本是2022(VisualStudioVersion=22.X)。

    CMake 和不同的 VS 版本以及不同的 SDK 有点混乱。

    对我有什么帮助:

    在 Visual Studio 安装程序中,修改您的 VisualStudio 安装,如 this 的顶部评论中所述。 (使用 C++ 进行桌面开发 > 可选 > MSVC v140 - VS 2015,应该在列表的底部

    如果您遇到另一个错误(发生在我身上),您可能需要安装 Windows SKD 8.1

    可能有一种方法可以更改 CMake 的 Visual Studio 版本,因为上述步骤对我有帮助,我还没有查看其他解决方案。

    如果这有帮助或者还有其他问题,请告诉我。

    干杯。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-11-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-10-15
      • 2019-10-16
      • 1970-01-01
      相关资源
      最近更新 更多