Question:
I'm trying to install scikit-learn via pip for python 3.9, but in the part that says "Installing build dependencies…" I get an error every time. I've already installed numpy and scipy, which are prerequisites, and I've even formatted my PC, but it still gives me the error. The error message is pretty big, but these are the beginning and ending lines, which I believe are the most important:
Installing build dependencies ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\alfredo\appdata\local\programs\python\python39\python.exe' 'c:\users\alfredo\appdata\local\programs\python\python39\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'C:\Users\Alfredo\AppData\Local\Temp\pip-build-env-rs86gbfh\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel 'Cython>=0.28.5' 'numpy==1.13.3; python_version=='"'"'3.6'"'"' and platform_system!='"'"'AIX'"'"' and platform_python_implementation == '"'"'CPython'"'"'' 'numpy==1.14.0; python_version=='"'"'3.6'"'"' and platform_system!='"'"'AIX'"'"' and platform_python_implementation != '"'"'CPython'"'"'' 'numpy==1.14.5; python_version=='"'"'3.7'"'"' and platform_system!='"'"'AIX'"'"'' 'numpy==1.17.3; python_version>='"'"'3.8'"'"' and platform_system!='"'"'AIX'"'"'' 'numpy==1.16.0; python_version=='"'"'3.6'"'"' and platform_system=='"'"'AIX'"'"'' 'numpy==1.16.0; python_version=='"'"'3.7'"'"' and platform_system=='"'"'AIX'"'"'' 'numpy==1.17.3; python_version>='"'"'3.8'"'"' and platform_system=='"'"'AIX'"'"'' 'scipy>=0.19.1'
cwd: None
.
.
.
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\alfredo\appdata\local\programs\python\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Alfredo\\AppData\\Local\\Temp\\pip-install-wn_2dnvm\\numpy_32582bf8a3d04f8fa43ffe9d540c089c\\setup.py'"'"'; __file__='"'"'C:\\Users\\Alfredo\\AppData\\Local\\Temp\\pip-install-wn_2dnvm\\numpy_32582bf8a3d04f8fa43ffe9d540c089c\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Alfredo\AppData\Local\Temp\pip-record-_e01fgoh\install-record.txt' --single-version-externally-managed --prefix 'C:\Users\Alfredo\AppData\Local\Temp\pip-build-env-rs86gbfh\overlay' --compile --install-headers 'C:\Users\Alfredo\AppData\Local\Temp\pip-build-env-rs86gbfh\overlay\Include\numpy' Check the logs for full command output.
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\alfredo\appdata\local\programs\python\python39\python.exe' 'c:\users\alfredo\appdata\local\programs\python\python39\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'C:\Users\Alfredo\AppData\Local\Temp\pip-build-env-rs86gbfh\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel 'Cython>=0.28.5' 'numpy==1.13.3; python_version=='"'"'3.6'"'"' and platform_system!='"'"'AIX'"'"' and platform_python_implementation == '"'"'CPython'"'"'' 'numpy==1.14.0; python_version=='"'"'3.6'"'"' and platform_system!='"'"'AIX'"'"' and platform_python_implementation != '"'"'CPython'"'"'' 'numpy==1.14.5; python_version=='"'"'3.7'"'"' and platform_system!='"'"'AIX'"'"'' 'numpy==1.17.3; python_version>='"'"'3.8'"'"' and platform_system!='"'"'AIX'"'"'' 'numpy==1.16.0; python_version=='"'"'3.6'"'"' and platform_system=='"'"'AIX'"'"'' 'numpy==1.16.0; python_version=='"'"'3.7'"'"' and platform_system=='"'"'AIX'"'"'' 'numpy==1.17.3; python_version>='"'"'3.8'"'"' and platform_system=='"'"'AIX'"'"'' 'scipy>=0.19.1' Check the logs for full command output.
Answer:
Try to update setuptools
pip install --upgrade setuptools
If it doesn't work, send the complete error if you have more there.