在anaconda-navigator中手動創建的python3.5, 然後再用
conda install numpy
conda instal scipy
安裝,兩個包的版本是自動適配環境的,並且用
conda search scipy --info
查看了numpy版本是符合依賴關係的。
但是運行時報錯:
RuntimeError: module compiled against API version 0xc but this version of numpy is 0xb
from scipy.optimize import minpack2
ImportError: numpy.core.multiarray failed to import
解決辦法
$ conda install -c conda-forge numpy
其中參數 -c 是指定下載包鏡像的位置:$ conda install -c <channel> <package/software>
記錄一下終端輸出:
Collecting package metadata: done
Solving environment: done
-
Package Plan
environment location: /home/ivy/anaconda2/envs/python3
added / updated specs:
- numpy -
The following packages will be downloaded:
package build blas-1.1 openblas 1 KB conda-forge ca-certificates-2019.3.9 hecc5488_0 146 KB conda-forge certifi-2018.8.24 py35_1001 139 KB conda-forge libgfortran-3.0.0 1 281 KB conda-forge libopenblas-0.2.20 h9ac9557_7 8.8 MB mkl_fft-1.0.9 py35_0 637 KB conda-forge mkl_random-1.0.1 py35_0 1.2 MB conda-forge numpy-1.15.2 py35_blas_openblashd3ea46f_0 9.2 MB conda-forge numpy-base-1.14.3 py35h2b20989_0 4.0 MB openblas-0.2.20 8 17.0 MB conda-forge openssl-1.0.2r h14c3975_0 3.1 MB conda-forge scipy-1.1.0 py35_blas_openblash7943236_201 40.1 MB conda-forge -
The following NEW packages will be INSTALLED:
libgfortran conda-forge/linux-64::libgfortran-3.0.0-1
libopenblas pkgs/main/linux-64::libopenblas-0.2.20-h9ac9557_7
openblas conda-forge/linux-64::openblas-0.2.20-8 -
The following packages will be UPDATED:
blas pkgs/main::blas-1.0-mkl --> conda-forge::blas-1.1-openblas
ca-certificates pkgs/main::ca-certificates-2019.1.23-0 --> conda-forge::ca-certificates-2019.3.9-hecc5488_0
certifi pkgs/main::certifi-2018.8.24-py35_1 --> conda-forge::certifi-2018.8.24-py35_1001
mkl_fft pkgs/main::mkl_fft-1.0.6-py35h7dd41cf~ --> conda-forge::mkl_fft-1.0.9-py35_0
scipy pkgs/main::scipy-1.1.0-py35hfa4b5c9_1 --> conda-forge::scipy-1.1.0-py35_blas_openblash7943236_201 -
The following packages will be SUPERSEDED by a higher-priority channel:
mkl_random pkgs/main::mkl_random-1.0.1-py35h4414~ --> conda-forge::mkl_random-1.0.1-py35_0
numpy pkgs/main::numpy-1.15.2-py35h1d66e8a_0 --> conda-forge::numpy-1.15.2-py35_blas_openblashd3ea46f_0
openssl pkgs/main::openssl-1.0.2r-h7b6447c_0 --> conda-forge::openssl-1.0.2r-h14c3975_0 -
The following packages will be DOWNGRADED:
numpy-base 1.15.2-py35h81de0dd_0 --> 1.14.3-py35h2b20989_0