简体   繁体   中英

In Anaconda couldn't download older version of scikit learn package using "pip install scikit-learn==0.21.3" Collecting scikit-learn==0.21.3 Using c

I'm getting this error:Collecting scikit-learn==0.21.3 Using cached scikit-learn-0.21.3.tar.gz (12.2 MB) Requirement already satisfied: numpy>=1.11.0 in c:\users\saiku\anaconda3\lib\site-packages (from scikit-learn==0.21.3) (1.20.3) Requirement already satisfied: scipy>=0.17.0 in c:\users\saiku\anaconda3\lib\site-packages (from scikit-learn==0.21.3) (1.7.1) Requirement already satisfied: joblib>=0.11 in c:\users\saiku\anaconda3\lib\site-packages (from scikit-learn==0.21.3) (1.1.0) Building wheels for collected packages: scikit-learn Building wheel for scikit-learn (setup.py) ... error ERROR: Command errored out with exit status 1: command: 'C:\Users\saiku\anaconda3\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\saiku\AppData\Local\Temp\pip-install-5qbqlc7i\scikit-learn_5b737429b0054d7baa7c92d177b7ccb3\setup.py'"'"'; file ='"'"'C:\Users\saiku\AppData\Local\Temp\pip-install-5qbqlc7i\scikit-learn_5b737429b0054d7baa7c92d177b7ccb3\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)( file ) if os.path.exists( file ) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file , '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\saiku\AppData\Local\Temp\pip-wheel-z7f6sdco' cwd: C:\Users\saiku\AppData\Local\Temp\pip-install-5qbqlc7i\scikit-learn_5b737429b0054d7baa7c92d177b7ccb3
Complete output (33 lines): Partial import of sklearn during the build process. No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils Traceback (most recent call last): File "", line 1, in File "C:\Users\saiku\AppData\Local\Temp\pip-install-5qbqlc7i\scikit-learn_5b737429b0054d7baa7c92d177b7ccb3\setup.py", line 290, in setup_package() File "C:\Users\saiku\AppData\Local\Temp\pip-install-5qbqlc7i\scikit-learn_5b737429b0054d7baa7c92d177b7ccb3\setup.py", line 286, in setup_package setup(**metadata) File "C:\Users\saiku\anaconda3\lib\site-packages\numpy\distutils\core.py", line 135, in setup config = configuration() File "C:\Users\saiku\AppData\Local\Temp\pip-install-5qbqlc7i\scikit-learn_5b737429b0054d7baa7c92d177b7ccb3\setup.py", line 174, in configuration config.add_subpackage('sklearn') File "C:\Users\saiku\anaconda3\lib\site-packages\numpy\distutils\misc_util.py", line 1019, in add_subpackage config_list = self.get_subpackage(subpackage_name, subpackage_path, File "C:\Users\saiku\anaconda3\lib\site-packages\numpy\distutils\misc_util.py", line 985, in get_subpackage config = self._get_configuratio n_from_setup_py( File "C:\Users\saiku\anaconda3\lib\site-packages\numpy\distutils\misc_util.py", line 927, in get_configuration_from_setup_py config = setup_module.configuration(*args) File "sklearn\setup.py", line 76, in configuration maybe_cythonize_extensions(top_path, config) File "C:\Users\saiku\AppData\Local\Temp\pip-install-5qbqlc7i\scikit-learn_5b737429b0054d7baa7c92d177b7ccb3\sklearn_build_utils_ init .py", line 42, in maybe_cythonize_extensions with_openmp = check_openmp_support() File "C:\Users\saiku\AppData\Local\Temp\pip-install-5qbqlc7i\scikit-learn_5b737429b0054d7baa7c92d177b7ccb3\sklearn_build_utils\openmp_helpers.py", line 83, in check_openmp_support ccompiler.compile(['test_openmp.c'], output_dir='objects', File "C:\Users\saiku\anaconda3\lib\distutils_msvccompiler.py", line 323, in compile self.initialize() File "C:\Users\saiku\anaconda3\lib\distutils_msvccompiler.py", line 220, in initialize vc_env = _get_vc_env(plat_spec) File "C:\Users\saiku\anaconda3\lib\site-pack ages\setuptools\msvc.py", line 316, in msvc14_get_vc_env return _msvc14_get_vc_env(plat_spec) File "C:\Users\saiku\anaconda3\lib\site-packages\setuptools\msvc.py", line 270, 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/

ERROR: Failed building wheel for scikit-learn Running setup.py clean for scikit-learn Failed to build scikit-learn Installing collected packages: scikit-learn Running setup.py install for scikit-learn ... error ERROR: Command errored out with exit status 1: command: 'C:\Users\saiku\anaconda3\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\saiku\AppData\Local\Temp\pip-install-5qbqlc7i\scikit-learn_5b737429b0054d7baa7c92d177b7ccb3\setup.py'"'"'; file ='"'"'C:\Users\saiku\AppData\Local\Temp\pip-install-5qbqlc7i\scikit-learn_5b737429b0054d7baa7c92d177b7ccb3\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)( file ) if os.path.exists( file ) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file , '"'"'exec'"'"'))' install --record 'C:\Users\saiku\AppData\Local\Temp\pip-record-hlouoqqy\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\saiku\anaconda3\Include\scikit-learn' cwd: C:\Users\saiku\AppData\Local\Temp\pip-install-5qbqlc7i\scikit-learn_5b737429b0054d7baa7c92d177b7ccb3
Complete output (33 lines): Partial import of sklearn during the build process. No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils Traceback (most recent call last): File "", line 1, in File "C:\Users\saiku\AppData\Local\Temp\pip-install-5qbqlc7i\scikit-learn_5b737429b0054d7baa7c92d177b7ccb3\setup.py", line 290, in setup_package() File "C:\Users\saiku\AppData\Local\Temp\pip-install-5qbqlc7i\scikit-learn_5b737429b0054d7baa7c92d177b7ccb3\setup.py", line 286, in setup_package setup(**metadata) File "C:\Users\saiku\anaconda3\lib\site-packages\numpy\distutils\core.py", line 135, in setup config = configuration() File "C:\Users\saiku\AppData\Local\Temp\pip-install-5qbqlc7i\scikit-learn_5b737429b0054d7baa7c92d177b7ccb3\setup.py", line 174, in configuration config.add_subpackage('sklearn') File "C:\Users\saiku\anaconda3\lib\site-packages\numpy\distutils\misc_util.py", line 1019, in add_subpackage config_list = self.get_subpackage(subpackage_name, subpackage_path, File "C:\Users\saiku\anaconda3\lib\site-packages\numpy\distutils\misc_util.py", line 985, in get_subpackage config = self._get_configuratio n_from_setup_py( File "C:\Users\saiku\anaconda3\lib\site-packages\numpy\distutils\misc_util.py", line 927, in get_configuration_from_setup_py config = setup_module.configuration(*args) File "sklearn\setup.py", line 76, in configuration maybe_cythonize_extensions(top_path, config) File "C:\Users\saiku\AppData\Local\Temp\pip-install-5qbqlc7i\scikit-learn_5b737429b0054d7baa7c92d177b7ccb3\sklearn_build_utils_ init .py", line 42, in maybe_cythonize_extensions with_openmp = check_openmp_support() File "C:\Users\saiku\AppData\Local\Temp\pip-install-5qbqlc7i\scikit-learn_5b737429b0054d7baa7c92d177b7ccb3\sklearn_build_utils\openmp_helpers.py", line 83, in check_openmp_support ccompiler.compile(['test_openmp.c'], output_dir='objects', File "C:\Users\saiku\anaconda3\lib\distutils_msvccompiler.py", line 323, in compile self.initialize() File "C:\Users\saiku\anaconda3\lib\distutils_msvccompiler.py", line 220, in initialize vc_env = _get_vc_env(plat_spec) File "C:\Users\saiku\anaconda3\lib\site-pack ages\setuptools\msvc.py", line 316, in msvc14_get_vc_env return _msvc14_get_vc_env(plat_spec) File "C:\Users\saiku\anaconda3\lib\site-packages\setuptools\msvc.py", line 270, 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/ ---------------------------------------- ERROR: Command errored out with exit status 1: 'C:\Users\saiku\anaconda3\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\saiku\AppData\Local\Temp\pip-install-5qbqlc7i\scikit-learn_5b737429b0054d7baa7c92d177b7ccb3\setup.py'"'"'; file ='"'"'C:\Users\saiku\AppData\Local\Temp\pip-install-5qbqlc7i\scikit-learn_5b737429b0054d7baa7c92d177b7ccb3\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)( file ) if os.path.exists( file ) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file , '"'"'exec'"'"'))' install --record 'C:\Users\saiku\AppData\Local\Temp\pip-record-hlouoqqy\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\saiku\anaconda3\Include\scikit-learn' Check the logs for full command output.

With the Anaconda Distribution installed you should use the conda package manager, not pip:

conda install -c intel scikit-learn=0.21.3

It's also a good idea to start with a new virtual environment to not get constraint by unnecessary dependencies, eg

conda create -n myenv -c intel scikit-learn=0.21.3

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM