错误:使用pip(Python 3.5.2)在Windows 10 64bit中安装SciPy

问题描述:

我想通过pip(命令行)在我的系统中安装SciPy包。它是一个Windows 10 64位系统。我已经安装了Python 3.5.2。我已经安装了其他机器学习和统计软件包,如numpy,sklearn,pandas,matplotlib,sympy,jupyter,ipython和nose。他们都已成功安装,没有任何错误。错误:使用pip(Python 3.5.2)在Windows 10 64bit中安装SciPy

我使用此命令从PIP安装SciPy的:


C:\Projects\Kaggle>pip install scipy


但在安装SciPy的,我收到此错误:

C:\Projects\Kaggle>pip install scipy Collecting scipy Using cached scipy-0.18.1.tar.gz Installing collected packages: scipy Running setup.py install for scipy ... error Complete output from command c:\users\i319268\appdata\local\programs\python\python35\python.exe -u -c "import setuptools, tokenize;file='C:\Users\i319268\AppData\Local\Temp\pip-build-b1nkbg30\scipy\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\i319268\AppData\Local\Temp\pip-06bz__e6-record\install-record.txt --single-version-externally-managed --compile:

Note: if you need reliable uninstall behavior, then install 
with pip instead of using `setup.py install`: 

    - `pip install .`  (from a git repo or downloaded source 
          release) 
    - `pip install scipy` (last SciPy release on PyPI) 


lapack_opt_info: 
openblas_lapack_info: 
    libraries openblas not found in ['c:\\users\\i319268\\appdata\\local\\programs\\python\\python35\\lib', 

'C:\', 'c:\users\i319268\appdata\local\programs\python\python35\libs'] NOT AVAILABLE

lapack_mkl_info: 
    libraries mkl_rt not found in ['c:\\users\\i319268\\appdata\\local\\programs\\python\\python35\\lib', 

'C:\', 'c:\users\i319268\appdata\local\programs\python\python35\libs'] NOT AVAILABLE

atlas_3_10_threads_info: 
Setting PTATLAS=ATLAS 
c:\users\i319268\appdata\local\programs\python\python35\lib\site-packages\numpy\distutils\system_info.py:639: 

UserWarning: Specified path C:\projects\numpy-wheels\windows-wheel-builder\atlas-builds\atlas-3.11.38-sse2-64\lib is invalid. warnings.warn('Specified path %s is invalid.' % d) NOT AVAILABLE

atlas_3_10_info: 
<class 'numpy.distutils.system_info.atlas_3_10_info'> 
    NOT AVAILABLE 

atlas_threads_info: 
Setting PTATLAS=ATLAS 
<class 'numpy.distutils.system_info.atlas_threads_info'> 
    NOT AVAILABLE 

atlas_info: 
<class 'numpy.distutils.system_info.atlas_info'> 
    NOT AVAILABLE 

c:\users\i319268\appdata\local\programs\python\python35\lib\site-packages\numpy\distutils\system_info.py:1532: 

UserWarning: Atlas (http://math-atlas.sourceforge.net/) libraries not found. Directories to search for the libraries can be specified in the numpy/distutils/site.cfg file (section [atlas]) or by setting the ATLAS environment variable. warnings.warn(AtlasNotFoundError.doc) lapack_info: libraries lapack not found in ['c:\users\i319268\appdata\local\programs\python\python35\lib', 'C:\', 'c:\users\i319268\appdata\local\programs\python\python35\libs'] NOT AVAILABLE

c:\users\i319268\appdata\local\programs\python\python35\lib\site-packages\numpy\distutils\system_info.py:1543: 

UserWarning: Lapack (http://www.netlib.org/lapack/) libraries not found. Directories to search for the libraries can be specified in the numpy/distutils/site.cfg file (section [lapack]) or by setting the LAPACK environment variable. warnings.warn(LapackNotFoundError.doc) lapack_src_info: NOT AVAILABLE

c:\users\i319268\appdata\local\programs\python\python35\lib\site-packages\numpy\distutils\system_info.py:1546: 

UserWarning: Lapack sources not found. Directories to search for the sources can be specified in the numpy/distutils/site.cfg file (section [lapack_src]) or by setting the LAPACK_SRC environment variable. warnings.warn(LapackSrcNotFoundError.doc) NOT AVAILABLE

Running from scipy source directory. 
Traceback (most recent call last): 
    File "<string>", line 1, in <module> 
    File "C:\Users\i319268\AppData\Local\Temp\pip-build-b1nkbg30\scipy\setup.py", 

line 415, in setup_package() File "C:\Users\i319268\AppData\Local\Temp\pip-build-b1nkbg30\scipy\setup.py", line 411, in setup_package setup(**metadata) File "c:\users\i319268\appdata\local\programs\python\python35\lib\site-packages\numpy\distutils\core.py", line 135, in setup config = configuration() File "C:\Users\i319268\AppData\Local\Temp\pip-build-b1nkbg30\scipy\setup.py", line 335, in configuration config.add_subpackage('scipy') File "c:\users\i319268\appdata\local\programs\python\python35\lib\site-packages\numpy\distutils\misc_util.py", line 1000, in add_subpackage caller_level = 2) File "c:\users\i319268\appdata\local\programs\python\python35\lib\site-packages\numpy\distutils\misc_util.py", line 969, in get_subpackage caller_level = caller_level + 1) File "c:\users\i319268\appdata\local\programs\python\python35\lib\site-packages\numpy\distutils\misc_util.py", line 906, in _get_configuration_from_setup_py config = setup_module.configuration(*args) File "scipy\setup.py", line 15, in configuration config.add_subpackage('linalg') File "c:\users\i319268\appdata\local\programs\python\python35\lib\site-packages\numpy\distutils\misc_util.py", line 1000, in add_subpackage caller_level = 2) File "c:\users\i319268\appdata\local\programs\python\python35\lib\site-packages\numpy\distutils\misc_util.py", line 969, in get_subpackage caller_level = caller_level + 1) File "c:\users\i319268\appdata\local\programs\python\python35\lib\site-packages\numpy\distutils\misc_util.py", line 906, in _get_configuration_from_setup_py config = setup_module.configuration(*args) File "scipy\linalg\setup.py", line 20, in configuration raise NotFoundError('no lapack/blas resources found') numpy.distutils.system_info.NotFoundError: no lapack/blas resources found

---------------------------------------- Command "c:\users\i319268\appdata\local\programs\python\python35\python.exe -u 

-c "import setuptools, tokenize;file='C:\Users\i319268\AppData\Local\Temp\pip-build-b1nkbg30\scipy\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\i319268\AppData\Local\Temp\pip-06bz__e6-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\i319268\AppData\Local\Temp\pip-build-b1nkbg30\scipy\

我也曾尝试来自Christoph Gohlke的非官方SciPy轮组件。当我试图从他的车轮安装的软件包,它提供了这样的错误:

C:\Projects\Kaggle>pip install scipy-0.18.1-cp36-cp36m-win32.whl

scipy-0.18.1-cp36-cp36m-win32.whl is not a supported wheel on this platform.

我已经看过StackOverflow的答案,但我完全被卡住,无法弄清楚什么。任何帮助将不胜感激。提前致谢。

+0

.whl名称中的“win32”表示它适用于32位Python。如果你有64位的Python,你需要一个“amd64”。看看是否有效。 – BrenBarn

+0

As @BrenBarn写道:您需要获得正确的车轮版本。你已经安装了python 3.5,所以你需要下载轮3.5而不是3.6 – MrLeeh

+0

非常感谢@BrenBarn。它说SciPy已经成功安装。 但在那之后,当我尝试导入Python代码SciPy的,它提供了这样的错误: >>>进口SciPy的 回溯(最近通话最后一个): 文件“”,1号线,在 来自numpy._distributor_init的文件“C:\ Users \ i319268 \ AppData \ Local \ Programs \ Python \ Python35 \ lib \ site-packages \ scipy \ __ init__.py”,第61行, import NUMPY_MKL#requires numpy + mkl ImportError:无法导入名称'NUMPY_MKL' – CodeZeus

这已经解决了。感谢@ BrenBarn在评论中提供的帮助,我现在已经完成了所有工作。

使用Christoph Gohlke中的轮子包进行工作的最佳方法。

但是,这里需要注意的是,你应该使用所有你想要的非官方软件包,因为许多软件包可能依赖于其他的轮子软件包。另一件需要牢记的事情是选择正确版本的轮胎包(32bit或64bit以及正确版本的python [主要在轮子包名称中提到的cp])。

例如,

SciPy wheel package for 64bit system and Python 3.6: scipy‑0.18.1‑cp36‑cp36m‑win_amd64.whl 

SciPy wheel package for 32bit system and Python 2.7: scipy‑0.18.1‑cp27‑cp27m‑win32.whl 

希望这将有助于其他人。再次感谢您的帮助@BrenBarn。