0

I am installing the scikit-survival package in Python. When I run

pip install scikit-survival 

I get an error on msbuild, I attach the elements of interest below:


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]                                                                                                                                                                                                                             
...                

The issue is with MSbuild.exe. Do you know how it can be solved? I have installed both Visual Studio Community with Python extensions and Visual Studio Build Tools.

vvvvv
  • 25,404
  • 19
  • 49
  • 81
Marco
  • 35
  • 1
  • 5
  • You could create a bug report for scikit-survival or qldl because that's where the build fails. A possibly easier solution: install scikit-survival with conda, see https://scikit-survival.readthedocs.io/en/stable/index.html – stijn Feb 02 '22 at 11:33
  • Thank you for your suggestion. I would like to avoid conda. I will try to ask to scikit-survival or qldl. – Marco Feb 02 '22 at 16:41

2 Answers2

1

try:

pip install pipwin
pipwin install <package>
Blastfurnace
  • 18,411
  • 56
  • 55
  • 70
Phil
  • 11
  • 1
0

It seems to be that your're using the wrong VisualStudio version. As mentioned in the Make command error VisualStudioVersion should be 14.0 (which is Visual Studio 2015), your Visual Studio Version is 2022 (VisualStudioVersion=22.X).

CMake and the different VS Versions as well as the different SDKs are a little bit confusing.

What helped me:

In the Visual Studio Installer, Modify your VisualStudio Installation as mentioned in the top comment of this. (Desktop development with C++ > Optional > MSVC v140 - VS 2015, should be at the bottom of the list)

If you're running in another error (which happened to me) you might have to install Windows SDK 8.1

There might be a way to change the Visual Studio Version for CMake, since the steps above helped me I haven't had a look at another solution.

Please let me know if this helps or if there is another problem.

Cheers.

David
  • 742
  • 5
  • 8