我正在运行命令" 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。知道是什么原因造成的吗?
答案 0 :(得分:0)
从这里安装http://www.lfd.uci.edu/~gohlke/pythonlibs/。如果你使用python 3.6和win64下载scikit_umfpack‑0.2.3‑cp36‑cp36m‑win_amd64.whl
这个。
答案 1 :(得分:0)
你能试试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
这对我有用