2015-01-11 85 views
1

我安裝了anaconda,並在這些mpmath之間安裝了很多python庫。 當我嘗試運行冪包我得到以下錯誤:ImportError:沒有名爲mpmath的模塊。但mpmath已安裝。怎麼了?

-> 1466   from mpmath import erfc 
    1467 #  from scipy.special import erfc 
    1468   from scipy.constants import pi 

ImportError: No module named mpmath 

此外,當我只是嘗試做import mpmath我得到同樣的錯誤。

我使用的是Fedora,我已經試過yum remove python-mpmath,然後yum install python-mpmath。但是我得到了同樣的錯誤。

我在其他問題中看到,這可能是因爲我有多個路徑,並且我必須使用sys.path = [''等等]來添加它們。

「sys.path = ['',etc]」是什麼意思?

當我這樣做:

print(sys.path) 

我得到:

['', '/home/rm/anaconda/bin', '/home/rm/anaconda/lib/python27.zip', '/home/rm/anaconda/lib/python2.7', '/home/rm/anaconda/lib/python2.7/plat-linux2', '/home/rm/anaconda/lib/python2.7/lib-tk', '/home/rm/anaconda/lib/python2.7/lib-old', 
'/home/rm/anaconda/lib/python2.7/lib-dynload', '/home/rm/anaconda/lib/python2.7/site-packages', '/home/rm/anaconda/lib/python2.7/site-packages/PIL', '/home/rm/anaconda/lib/python2.7/site-packages/runipy-0.1.0-py2.7.egg', '/home/rm/anaconda/lib/python2.7/site-packages/setuptools-3.6-py2.7.egg', '/home/rm/anaconda/lib/python2.7/site-packages/IPython/extensions', 
'/home/rm/.ipython'] 
+0

http://stackoverflow.com/questions/26599443/module-successfully-installed-but-not-found-in-ipython – Ashalynd

+0

如何添加兩個路徑?我怎麼知道他們是哪一個?編輯問題的更多信息 –

+1

你是否從安裝w/anaconda的單獨的Python安裝?基於上面的問題,嘗試運行IDLE解釋器並執行'import sys;打印(sys.path中)'。你有不同的路徑嗎? – zehnpaard

回答

1

您應該使用暢達到Python包安裝到蟒蛇,或點子,如果他們無法通過暢達。 conda install mpmath應該解決您的問題。

相關問題