0

I installed python anaconda on my computer Windows10 and created new environment in it. Then, I tried to install the package "scikit-learn" with pip on cmd in it, but this error below was returned. Why cannot I install and how should I do?


C:\Users\nima>pip install scikit-learn==0.19.1
Collecting scikit-learn==0.19.1
  Using cached https://files.pythonhosted.org/packages/f5/2c/5edf2488897cad4fb8c4ace86369833552615bf264460ae4ef6e1f258982/scikit-learn-0.19.1.tar.gz
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\nima\Anaconda3\envs\aidemy\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\nima\\AppData\\Local\\Temp\\pip-install-jijyje_y\\scikit-learn\\setup.py'"'"'; __file__='"'"'C:\\Users\\nima\\AppData\\Local\\Temp\\pip-install-jijyje_y\\scikit-learn\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\nima\AppData\Local\Temp\pip-wheel-3o9s77c6' --python-tag cp37
       cwd: C:\Users\nima\AppData\Local\Temp\pip-install-jijyje_y\scikit-learn\
  Complete output (735 lines):
  Partial import of sklearn during the build process.
  blas_opt_info:
  blas_mkl_info:
  No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
  customize MSVCCompiler
    libraries mkl_rt not found in ['C:/Users/nima/Anaconda3/envs/aidemy\\Library\\lib']
    NOT AVAILABLE

  blis_info:
  No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
  customize MSVCCompiler
    libraries blis not found in ['C:\\Users\\nima\\Anaconda3\\envs\\aidemy\\lib', 'C:\\', 'C:\\Users\\nima\\Anaconda3\\envs\\aidemy\\libs', 'C:\\Users\\nima\\Anaconda3\\Library\\lib']
    NOT AVAILABLE

  openblas_info:
  No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
  customize MSVCCompiler
  No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
  customize MSVCCompiler
    libraries openblas not found in ['C:\\Users\\nima\\Anaconda3\\envs\\aidemy\\lib', 'C:\\', 'C:\\Users\\nima\\Anaconda3\\envs\\aidemy\\libs', 'C:\\Users\\nima\\Anaconda3\\Library\\lib']
  get_default_fcompiler: matching types: '['gnu', 'intelv', 'absoft', 'compaqv', 'intelev', 'gnu95', 'g95', 'intelvem', 'intelem', 'flang']'
  customize GnuFCompiler
  Could not locate executable g77

  ...

  customize PGroupFlangCompiler
  Could not locate executable flang
  don't know how to compile Fortran code on platform 'nt'
    NOT AVAILABLE

  atlas_3_10_blas_threads_info:
  Setting PTATLAS=ATLAS
  No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
  customize MSVCCompiler
    libraries tatlas not found in ['C:\\Users\\nima\\Anaconda3\\envs\\aidemy\\lib', 'C:\\', 'C:\\Users\\nima\\Anaconda3\\envs\\aidemy\\libs', 'C:\\Users\\nima\\Anaconda3\\Library\\lib']
    NOT AVAILABLE


...

nima
  • 19
  • 5
  • This seems to cover your issue: https://stackoverflow.com/questions/41060382/using-pip-to-install-packages-to-anaconda-environment – neutrino_logic Oct 23 '19 at 18:54

1 Answers1

0

If you installed Anaconda, the best way to install a package would be to install it with anaconda. To do this, go to the command line like you did and try

conda install -c anaconda scikit-learn

It is also here, and you can use this site to look up specific install instructions for other anaconda packages. Hope this helps!

Jack Hanson
  • 336
  • 1
  • 2
  • 11