How to install MatPlotLib on Mac 10.7 in virtualen

2020-05-26 03:07发布

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.

3条回答
一夜七次
2楼-- · 2020-05-26 03:36

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 git+https://github.com/matplotlib/matplotlib.git#egg=matplotlib
查看更多
Ridiculous、
3楼-- · 2020-05-26 03:36

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:

Install

Download Scipy Superpack Installer for OSX 10.7

To install, open a terminal in the directory that the script is located and call:

$ sh install_superpack.sh

You will be prompted for your administrator password. If you have already installed the current gFortran, you can bypass that package during the install process. Similarly, the installation requires Git, so you will be prompted to install it if you are installing remotely.

查看更多
爷、活的狠高调
4楼-- · 2020-05-26 03:43

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

查看更多
登录 后发表回答