在Mac OS X Lion中安装(Build)Matplotlib [英] Installing (build) matplotlib in mac osx lion
本文介绍了在Mac OS X Lion中安装(Build)Matplotlib的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我安装了 pynum 和 scipy(在带有 python 2.7 的 osx Lion 上),但是当我尝试构建 matplotlib 时
I installed pynum and scipy (on osx Lion with python 2.7), but when I tried to build matplotlib
git clone https://github.com/matplotlib/matplotlib.git
cd matplotlib
python setup.py build
python setup.py install
我遇到了这些错误:
/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/ATSTypes.h:242: error: declaration for parameter ‘FMFontDirectoryFilter’ but no such parameter
src/_macosx.m:5912: error: expected ‘{’ at end of input
lipo: can't open input file: /var/folders/qw/pr2f7vq91b3c3ngkxrrqplm8zkv09r/T//ccAgEklo.out (No such file or directory)
error: command 'llvm-gcc-4.2' failed with exit status 1
有人能告诉我有什么问题吗?
Could somebody please tell me what is the problem?
附言最初,我尝试以这种方式安装它:
P.S. At first I tried to install it in this way:
pip install -e git+https://github.com/matplotlib/matplotlib#egg=matplotlib-dev
但它对我不起作用
推荐答案
我总是觉得这个过程比原本要痛苦得多,但是我已经做过几次了,我相信这些步骤应该可以帮助您进行设置:
I always find this process more painful than it should be, but I've done it a few times now and I believe that these steps should get you set up:
- 获取 Xcode 4.3.2,它是后续某些步骤所必需的.
- 从 python.org 下载适用于 OSX 的最新版 python
- 获取 Scipy超级包装.
- 卸载您当前拥有的任何先前版本的 numpy/matplotlib/scipy.这包括执行
cd/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/
并将所有numpy/matplotlib/scipy目录或鸡蛋移动到临时目录中. -
cd〜/Downloads
(或将Superpack脚本下载到的位置)并运行sh install_superpack.sh
.否问题是从克隆到此计算机的存储库中安装
,否则您将对脚本为何不断失败感到困惑.
- Get Xcode 4.3.2, it's required for some of the later steps.
- Download the latest version of python for OSX from python.org
- Grab the Scipy superpack.
- Uninstall any previous versions of numpy/matplotlib/scipy that you currently have. That includes doing
cd /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/
and moving any numpy/matplotlib/scipy directories or eggs into a temp directory. cd ~/Downloads
(or wherever you downloaded the superpack script to) and runsh install_superpack.sh
. Answer no to the questionare you installing from a repository cloned to this machine
or you'll be confused about why the script keeps failing.
应该的!现在,您应该能够启动python控制台并 import numpy,scipy,matplotlib
.
That should be it! You should now be able to boot up the python console and import numpy, scipy, matplotlib
.
这篇关于在Mac OS X Lion中安装(Build)Matplotlib的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文