【发布时间】: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 都是最新的。知道是什么原因造成的吗?
【问题讨论】:
-
Duplicate of Error while trying to install sklearn from Pycharm | arrayobject.h cannot be absolute -- "Python 3.6(最新版本)尚不支持,您可以考虑降级(实际重新安装)到 Python 3.5 .. 显然,sklearn 在支持 Python 3.6 时几乎没有问题那一刻。”
标签: python scikit-learn