2017-01-10 170 views
2

我想通過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

回答

3

這已經解決了。感謝@ 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。