[英]Failed “import matplotlib.pylab” due to /backends/_macosx.so Reason: image not found
通過2.mpkg安裝的Python 2.7.3。
導入matplotlib.pylabTraceback(最近一次通話):文件“ /”、“Library/Python/2.7/site-packages/matplotlib-1.2.x-py2.7.egg/matplotlib/pylab.py”中的第1行matplotlib.pyplot導入中的第265行,*文件“ /Library/Python/2.7/site-packages/matplotlib-1.2.x-py2.7.egg/matplotlib/pyplot.py”的第97行,在new_figure_manager中,draw_if_interactive ,_show = pylab_setup()文件“ /Library/Python/2.7/site-packages/matplotlib-1.2.x-py2.7.egg/matplotlib/backends/ init .py”,第25行,在pylab_setup globals()中,本地(),[backend_name])文件“ /Library/Python/2.7/site-packages/matplotlib-1.2.x-py2.7.egg/matplotlib/backends/backend_macosx.py”,行21,來自matplotlib.backends導入_macosx ImportError:dlopen(/Library/Python/2.7/site-packages/matplotlib-1.2.x-py2.7.egg/matplotlib/backends/_macosx.so,2):庫未加載:/ System / Library / Frameworks /從/Library/Python/2.7/site-packages/matplotlib-1.2.x-py2.7.egg/matplotlib/backends/_maco引用的CoreText.framework / Versions / A / CoreText sx.so原因:找不到圖像
您是否安裝了numpy 1.4或更高版本? 其他先決條件可以找到http://matplotlib.org/users/installing.html 。
當我缺少依賴項時,我收到了類似的模棱兩可的消息。
我自己安裝MatplotLib軟件包時遇到了一些麻煩。 在這里查看我的答案如何解決它:
另請參閱:
http://www.zqna.net/qna/knuzvt-i-am-getting-this-error-on-using-matplotlib.html
我的解決方案:
我有OS X 10.7.5,運行python 2.7.1,numpy-1.8.0.dev_4600b2f_20130131-py2.7-macosx-10.8-intel.egg,scipy-0.12.0.dev_b69fe18_20130131-py2.7-macosx-10.8-智力蛋
以前,我遇到了上面列出的錯誤,其中matplotlib 1.3無法找到CoreText.framework,但是當我恢復為matplotlib 1.2時,該錯誤消失了,並且我能夠很好地運行它-我只是編輯了easy_install.pth文件(不確定這是否是解決問題的正確方法,但是我不需要進行符號鏈接,因為舊的1.2版本可以正常工作)
簡易安裝是2013年2月8日從fonnesbeck scipy superpack進行的重新安裝,自去年秋天以來,我一直在嘗試獲取新的內容。
這對我有用:
brew install pkg-config
brew link pkg-config
brew install pygtk
brew install freetype
brew install libpng
sudo ln -s /usr/local/Cellar/freetype/*/lib/pkgconfig/freetype2.pc /usr/local/lib/pkgconfig/freetype2.pc
git clone git@github.com:matplotlib/matplotlib.git
cd matplotlib
python setup.py build
python setup.py install
參考文獻:
http://blog.caoyuan.me/2012/08/matplotlib-error-mac-os-x/ http://matplotlib.org/faq/installing_faq.html#install-from-git http://www.tapir .caltech.edu /〜dtsang / python.html
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.