如何在 Mac 10.7 上的 virtualenv 中安装 MatPlotLib
我尝试做的事情是:
(SAASSenv)miki725mac:SAASSenv miki725$ python
Python 2.7.2 (v2.7.2:8527427914a2, Jun 11 2011, 15:22:34)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
(SAASSenv)miki725mac:SAASSenv miki725$
(SAASSenv)miki725mac:SAASSenv miki725$ pip install http://downloads.sourceforge.net/project/matplotlib/matplotlib/matplotlib-1.0.1/matplotlib-1.0.1.tar.gz
Downloading/unpacking http://downloads.sourceforge.net/project/matplotlib/matplotlib/matplotlib-1.0.1/matplotlib-1.0.1.tar.gz
Downloading matplotlib-1.0.1.tar.gz (13.3Mb): 13.3Mb downloaded
Running setup.py egg_info for package from http://downloads.sourceforge.net/project/matplotlib/matplotlib/matplotlib-1.0.1/matplotlib-1.0.1.tar.gz
basedirlist is: []
============================================================================
BUILDING MATPLOTLIB
matplotlib: 1.0.1
python: 2.7.2 (v2.7.2:8527427914a2, Jun 11 2011, 15:22:34)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)]
platform: darwin
REQUIRED DEPENDENCIES
numpy: 1.6.0
freetype2: 13.0.7
OPTIONAL BACKEND DEPENDENCIES
libpng: 1.4.8
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "/var/folders/tk/xpmf2q_10qg45c9g_xzmvy4r0000gn/T/pip-02sOum-build/setup.py", line 162, in <module>
if check_for_tk() or (options['build_tkagg'] is True):
File "setupext.py", line 832, in check_for_tk
(Tkinter.__version__.split()[-2], Tkinter.TkVersion, Tkinter.TclVersion))
IndexError: list index out of range
Complete output from command python setup.py egg_info:
basedirlist is: []
============================================================================
BUILDING MATPLOTLIB
matplotlib: 1.0.1
python: 2.7.2 (v2.7.2:8527427914a2, Jun 11 2011, 15:22:34)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)]
platform: darwin
REQUIRED DEPENDENCIES
numpy: 1.6.0
freetype2: 13.0.7
OPTIONAL BACKEND DEPENDENCIES
libpng: 1.4.8
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "/var/folders/tk/xpmf2q_10qg45c9g_xzmvy4r0000gn/T/pip-02sOum-build/setup.py", line 162, in <module>
if check_for_tk() or (options['build_tkagg'] is True):
File "setupext.py", line 832, in check_for_tk
(Tkinter.__version__.split()[-2], Tkinter.TkVersion, Tkinter.TclVersion))
IndexError: list index out of range
----------------------------------------
Command python setup.py egg_info failed with error code 1
Storing complete log in /Users/miki725/.pip/pip.log
请帮助我。如果您需要任何其他信息,请告诉我。谢谢。
Here what I try to do:
(SAASSenv)miki725mac:SAASSenv miki725$ python
Python 2.7.2 (v2.7.2:8527427914a2, Jun 11 2011, 15:22:34)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
(SAASSenv)miki725mac:SAASSenv miki725$
(SAASSenv)miki725mac:SAASSenv miki725$ pip install http://downloads.sourceforge.net/project/matplotlib/matplotlib/matplotlib-1.0.1/matplotlib-1.0.1.tar.gz
Downloading/unpacking http://downloads.sourceforge.net/project/matplotlib/matplotlib/matplotlib-1.0.1/matplotlib-1.0.1.tar.gz
Downloading matplotlib-1.0.1.tar.gz (13.3Mb): 13.3Mb downloaded
Running setup.py egg_info for package from http://downloads.sourceforge.net/project/matplotlib/matplotlib/matplotlib-1.0.1/matplotlib-1.0.1.tar.gz
basedirlist is: []
============================================================================
BUILDING MATPLOTLIB
matplotlib: 1.0.1
python: 2.7.2 (v2.7.2:8527427914a2, Jun 11 2011, 15:22:34)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)]
platform: darwin
REQUIRED DEPENDENCIES
numpy: 1.6.0
freetype2: 13.0.7
OPTIONAL BACKEND DEPENDENCIES
libpng: 1.4.8
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "/var/folders/tk/xpmf2q_10qg45c9g_xzmvy4r0000gn/T/pip-02sOum-build/setup.py", line 162, in <module>
if check_for_tk() or (options['build_tkagg'] is True):
File "setupext.py", line 832, in check_for_tk
(Tkinter.__version__.split()[-2], Tkinter.TkVersion, Tkinter.TclVersion))
IndexError: list index out of range
Complete output from command python setup.py egg_info:
basedirlist is: []
============================================================================
BUILDING MATPLOTLIB
matplotlib: 1.0.1
python: 2.7.2 (v2.7.2:8527427914a2, Jun 11 2011, 15:22:34)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)]
platform: darwin
REQUIRED DEPENDENCIES
numpy: 1.6.0
freetype2: 13.0.7
OPTIONAL BACKEND DEPENDENCIES
libpng: 1.4.8
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "/var/folders/tk/xpmf2q_10qg45c9g_xzmvy4r0000gn/T/pip-02sOum-build/setup.py", line 162, in <module>
if check_for_tk() or (options['build_tkagg'] is True):
File "setupext.py", line 832, in check_for_tk
(Tkinter.__version__.split()[-2], Tkinter.TkVersion, Tkinter.TclVersion))
IndexError: list index out of range
----------------------------------------
Command python setup.py egg_info failed with error code 1
Storing complete log in /Users/miki725/.pip/pip.log
Please help me. If you need any additional info, please let me know. Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
locojays 行对我不起作用(osx 10.7,通过自制程序的 Python 2.7.2),我必须修改命令如下:
locojays line didn't work for me (osx 10.7, Python 2.7.2 via homebrew), I had to modify the command as follows:
只需执行
pip install -e https://github.com/matplotlib/matplotlib.git matplotlib
或克隆然后安装
或查看@
http://jholewinski.org/blog/installing-matplotlib-on-os-x-10-7-with-homebrew/
但这不是狮子问题,只是 python 2.7 的问题。 2 错误。在同事的雪豹机器上遇到了同样的问题
假设你正在使用brew
希望这会有所帮助
just do
pip install -e https://github.com/matplotlib/matplotlib.git matplotlib
or clone and then install
or have a look @
http://jholewinski.org/blog/installing-matplotlib-on-os-x-10-7-with-homebrew/
but it s not a lion problem just a python 2.7.2 bug. had the same problem on a colleagues snow leopard machine
suppose your are using brew
hope this helps
在 OSX 10.7 中,我使用了“Scipy Superpack”安装脚本,现在 matplotlib 工作正常。
http://fonnesbeck.github.com/ScipySuperpack/
花了两个步骤和几分钟:
With OSX 10.7, I used the "Scipy Superpack" install script, and now I have matplotlib working fine.
http://fonnesbeck.github.com/ScipySuperpack/
It took two steps and a few minutes: