【问题标题】:How should I install the packages with pip?我应该如何使用 pip 安装软件包?
【发布时间】:2019-10-24 04:52:29
【问题描述】:

我在我的计算机 Windows10 上安装了 python anaconda 并在其中创建了新环境。然后,我尝试在 cmd 上安装带有 pip 的包“scikit-learn”,但返回了以下错误。为什么我不能安装,我该怎么办?


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


...

【问题讨论】:

标签: python pip anaconda


【解决方案1】:

如果您安装了 Anaconda,安装软件包的最佳方法是使用 anaconda 进行安装。为此,请像您一样转到命令行并尝试

conda install -c anaconda scikit-learn

它也是here,您可以使用此站点查找其他anaconda 软件包的具体安装说明。希望这会有所帮助!

【讨论】:

    猜你喜欢
    • 2016-09-23
    • 1970-01-01
    • 2019-04-21
    • 2018-06-25
    • 1970-01-01
    • 2020-01-31
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多