【问题标题】:Installing Python Scikit-Learn安装 Python Scikit-Learn
【发布时间】:2017-05-09 16:45:37
【问题描述】:

我正在运行命令“pip3 install scikit-learn”,命令提示符吐出以下错误:

reading manifest file 'scikit_learn.egg-info\SOURCES.txt'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\NATHAN~1\AppData\Local\Temp\pip-build-l0z1x7if\scikit-learn\setup.py", line 270, in <module>
    setup_package()
  File "C:\Users\NATHAN~1\AppData\Local\Temp\pip-build-l0z1x7if\scikit-learn\setup.py", line 266, in setup_package
    setup(**metadata)
  File "c:\users\nathanholt\appdata\local\programs\python\python36-32\lib\site-packages\numpy\distutils\core.py", line 171, in setup
    return old_setup(**new_attr)
  File "c:\users\nathanholt\appdata\local\programs\python\python36-32\lib\distutils\core.py", line 148, in setup
    dist.run_commands()
  File "c:\users\nathanholt\appdata\local\programs\python\python36-32\lib\distutils\dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "c:\users\nathanholt\appdata\local\programs\python\python36-32\lib\distutils\dist.py", line 974, in run_command
    cmd_obj.run()
  File "c:\users\nathanholt\appdata\local\programs\python\python36-32\lib\site-packages\numpy\distutils\command\install.py", line 62, in run
    r = self.setuptools_run()
  File "c:\users\nathanholt\appdata\local\programs\python\python36-32\lib\site-packages\numpy\distutils\command\install.py", line 36, in setuptools_run
    return distutils_install.run(self)
  File "c:\users\nathanholt\appdata\local\programs\python\python36-32\lib\distutils\command\install.py", line 557, in run
    self.run_command(cmd_name)
  File "c:\users\nathanholt\appdata\local\programs\python\python36-32\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "c:\users\nathanholt\appdata\local\programs\python\python36-32\lib\distutils\dist.py", line 974, in run_command
    cmd_obj.run()
  File "c:\users\nathanholt\appdata\local\programs\python\python36-32\lib\site-packages\setuptools\command\install_egg_info.py", line 34, in run
    self.run_command('egg_info')
  File "c:\users\nathanholt\appdata\local\programs\python\python36-32\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "c:\users\nathanholt\appdata\local\programs\python\python36-32\lib\distutils\dist.py", line 974, in run_command
    cmd_obj.run()
  File "c:\users\nathanholt\appdata\local\programs\python\python36-32\lib\site-packages\numpy\distutils\command\egg_info.py", line 19, in run
    _egg_info.run(self)
  File "c:\users\nathanholt\appdata\local\programs\python\python36-32\lib\site-packages\setuptools\command\egg_info.py", line 279, in run
    self.find_sources()
  File "c:\users\nathanholt\appdata\local\programs\python\python36-32\lib\site-packages\setuptools\command\egg_info.py", line 306, in find_sources
    mm.run()
  File "c:\users\nathanholt\appdata\local\programs\python\python36-32\lib\site-packages\setuptools\command\egg_info.py", line 533, in run
    self.add_defaults()
  File "c:\users\nathanholt\appdata\local\programs\python\python36-32\lib\site-packages\setuptools\command\egg_info.py", line 569, in add_defaults
    self.read_manifest()
  File "c:\users\nathanholt\appdata\local\programs\python\python36-32\lib\site-packages\setuptools\command\sdist.py", line 201, in read_manifest
    self.filelist.append(line)
  File "c:\users\nathanholt\appdata\local\programs\python\python36-32\lib\site-packages\setuptools\command\egg_info.py", line 475, in append
    path = convert_path(item)
  File "c:\users\nathanholt\appdata\local\programs\python\python36-32\lib\distutils\util.py", line 125, in convert_path
    raise ValueError("path '%s' cannot be absolute" % pathname)
ValueError: path '/home/andy/anaconda3/lib/python3.5/site-packages/numpy/core/include/numpy/arrayobject.h' cannot be absolute
Command "c:\users\nathanholt\appdata\local\programs\python\python36-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\NATHAN~1\\AppData\\Local\\Temp\\pip-build-l0z1x7if\\scikit-learn\\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\NATHAN~1\AppData\Local\Temp\pip-7iz3ig6v-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\NATHAN~1\AppData\Local\Temp\pip-build-l0z1x7if\scikit-learn\"

我知道我的 numpy+MKL 和 Scipy 以及我的 C++ Redistributable 都是最新的。知道是什么原因造成的吗?

【问题讨论】:

标签: python scikit-learn


【解决方案1】:

从这里安装它 http://www.lfd.uci.edu/~gohlke/pythonlibs/ 。如果你使用python 3.6和win64下载scikit_umfpack‑0.2.3‑cp36‑cp36m‑win_amd64.whl这个。

【讨论】:

    【解决方案2】:

    你能用Anaconda试试吗? https://www.continuum.io/downloads#windows 安装 anaconda 后,您可以使用 conda 创建一个虚拟环境: conda create -n myenv python=3.5

    之后,您将激活 evn source activate myenv (myenv)$ conda install scikit-learn

    这对我有用

    【讨论】:

      猜你喜欢
      • 2014-06-05
      • 2017-08-30
      • 1970-01-01
      • 2019-02-03
      • 2014-04-30
      • 2013-09-29
      • 2022-01-17
      • 2014-06-27
      • 1970-01-01
      相关资源
      最近更新 更多