0

我正在 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。

4

2 回答 2

0

尝试:

pip install pipwin
pipwin install <package>
于 2022-02-23T17:58:36.493 回答
0

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

CMake 和不同的 VS 版本以及不同的 SDK 有点令人困惑。

对我有什么帮助:

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

如果您正在运行另一个错误(发生在我身上),您可能必须安装 Windows SKD 8.1

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

请让我知道这是否有帮助或是否还有其他问题。

干杯。

于 2022-02-11T11:44:27.737 回答