我使用python 3.4.2,我相信我下載了它從python.org。我在El Capitan的Mac上運行它。安裝Python庫SciPy的和matplotlib但不能導入
我嘗試下載SciPy的使用蟒蛇的圖形安裝界面。運行安裝程序後,我打開空閒和嘗試:
>>> import scipy
但得到的錯誤:
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import scipy
ImportError: No module named 'scipy'
我試着用numpy的同樣的事情,但得到了同樣的錯誤。
然後我嘗試安裝matplotlib,但這次我想我應該嘗試使用命令行點子。首先我試過:
dhcp-wifi-8021x-155-41-121-77:~ theMAN$ pip install matplotlib
Requirement already satisfied: matplotlib in
./anaconda/lib/python3.6/site-packages
Requirement already satisfied: numpy>=1.7.1 in
./anaconda/lib/python3.6/site-packages (from matplotlib)
Requirement already satisfied: six>=1.10 in
./anaconda/lib/python3.6/site-packages (from matplotlib)
Requirement already satisfied: python-dateutil in
./anaconda/lib/python3.6/site-packages (from matplotlib)
Requirement already satisfied: pytz in ./anaconda/lib/python3.6/site-
packages (from matplotlib)
Requirement already satisfied: cycler>=0.10 in
./anaconda/lib/python3.6/site-packages (from matplotlib)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=1.5.6
in ./anaconda/lib/python3.6/site-packages (from matplotlib)
但試圖導入scipy,numpy和matplotlib仍然返回相同的錯誤。我也試着用pip卸載並重新安裝scipy,但那並沒有改變任何東西。
模塊安裝不正確?他們是否已安裝,但我沒有正確導入它們?
當你嘗試'pip install scipy'時,輸出是什麼...這個軟件包被稱爲有點棘手。這就是爲什麼有些人使用'conda'而不是'pip' – MattR
我剛試過,沒有運氣:( –