我已經安裝了蟒蛇和MacPorts的當我嘗試導入安裝各種Python包,並收到以下錯誤matplotlib:Python的rcParams錯誤
bash-3.2$ python
Python 2.7.8 |Anaconda 2.1.0 (x86_64)| (default, Aug 21 2014, 15:21:46)
[GCC 4.2.1 (Apple Inc. build 5577)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://binstar.org
>>> import conda
>>> import matplotlib
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/colinross/anaconda/lib/python2.7/site-packages/matplotlib-1.4.3-py2.7-macosx-10.5-x86_64.egg/matplotlib/__init__.py", line 169, in <module>
from urllib2 import urlopen
File "/Users/colinross/anaconda/lib/python2.7/urllib2.py", line 104, in <module>
import bisect
File "bisect.py", line 2, in <module>
import matplotlib.pyplot as plt
File "/Users/colinross/anaconda/lib/python2.7/site-packages/matplotlib-1.4.3-py2.7-macosx-10.5-x86_64.egg/matplotlib/pyplot.py", line 27, in <module>
import matplotlib.colorbar
File "/Users/colinross/anaconda/lib/python2.7/site-packages/matplotlib-1.4.3-py2.7-macosx-10.5-x86_64.egg/matplotlib/colorbar.py", line 32, in <module>
import matplotlib.artist as martist
File "/Users/colinross/anaconda/lib/python2.7/site-packages/matplotlib-1.4.3-py2.7-macosx-10.5-x86_64.egg/matplotlib/artist.py", line 11, in <module>
from matplotlib import docstring, rcParams
ImportError: cannot import name rcParams
有誰知道如何解決這一問題?當您導入matplotlib,matplotlib進口urllib2
庫,這反過來又試圖導入標準庫bisect
模塊:
它看起來好像你有一個你自己稱爲'bisect.py'的模塊;這是標準庫的「平分」模塊的陰影。重命名你的'bisect.py'模塊並重試。 –
謝謝!這工作。現在我收到一個新的錯誤。 ImportError:dlopen(/Users/colinross/anaconda/lib/python2.7/site-packages/matplotlib-1.4.3-py2.7-macosx-10.5-x86_64.egg/matplotlib/ft2font.so,2):Library not加載:libfreetype.6.dylib 引用自:/Users/colinross/anaconda/lib/python2.7/site-packages/matplotlib-1.4.3-py2.7-macosx-10.5-x86_64.egg/matplotlib/ft2font。 so 原因是:image not found – user3711780
這是一個完全不同的問題,可能是conda的人之一:解決方案將取決於你如何安裝matplotlib及其依賴項(如freetype)。 –