我在这些 mpmath 之间安装了 anaconda 和许多 python 库。当我尝试运行 powerlaw 包时,出现以下错误:
-> 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']