【问题标题】:How to install MatPlotLib on Mac 10.7 in virtualenv如何在 Mac 10.7 上的 virtualenv 中安装 MatPlotLib
【发布时间】:2011-10-19 16:41:56
【问题描述】:

这是我尝试做的:

(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

请帮助我。如果您需要任何其他信息,请告诉我。谢谢。

【问题讨论】:

    标签: python installation matplotlib virtualenv


    【解决方案1】:

    只是做

    pip install -e https://github.com/matplotlib/matplotlib.gitmatplotlib

    或克隆然后安装

    或者看看@

    http://jholewinski.org/blog/installing-matplotlib-on-os-x-10-7-with-homebrew/

    但这不是一个狮子问题,只是一个 python 2.7.2 错误。在同事的雪豹机上遇到同样的问题

    假设你正在使用 brew

    希望对你有帮助

    【讨论】:

      【解决方案2】:

      locojays 行对我不起作用(osx 10.7,Python 2.7.2 via homebrew),我不得不修改命令如下:

      pip install -e git+https://github.com/matplotlib/matplotlib.git#egg=matplotlib
      

      【讨论】:

      • “+https”对我不起作用。我安装了“sudo pip-2.7 install -e git://github.com/matplotlib/matplotlib.git#egg=matplotlib”
      • 您使用的是什么版本的 pip?我正在使用pip 1.0.2 from /usr/local/lib/python2.7/site-packages (python 2.7),这是我从运行pip --version得到的
      • --version 报告'pip 1.0.1 from /usr/local/lib/python2.7/site-packages/pip-1.0.1-py2.7.egg'
      • 奇数。似乎git+https:// 协议被添加回version 0.8.2。好吧,很高兴你成功了!
      • 奇怪,但还不够奇怪,我想追查原因。感谢您的回答!
      【解决方案3】:

      在 OSX 10.7 中,我使用了“Scipy Superpack”安装脚本,现在我的 matplotlib 工作正常。

      http://fonnesbeck.github.com/ScipySuperpack/

      花了两步又几分钟:

      安装

      Download Scipy Superpack Installer for OSX 10.7

      要安装,请在脚本所在的目录中打开一个终端 定位并致电:

      $ sh install_superpack.sh

      系统将提示您选择管理员 密码。如果你已经安装了当前的 gFortran,你可以 在安装过程中绕过该软件包。同样, 安装需要Git,所以如果你会被提示安装它 您正在远程安装。

      【讨论】:

        猜你喜欢
        • 2012-11-09
        • 1970-01-01
        • 2012-03-29
        • 1970-01-01
        • 1970-01-01
        • 2011-10-25
        • 1970-01-01
        • 2013-04-10
        • 2012-01-09
        相关资源
        最近更新 更多