2011-08-04 13 views
14

Aquí lo que trato de hacer:Cómo instalar matplotlib en Mac 10.7 en virtualenv

(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 

por favor me ayude. Si necesita información adicional, hágamelo saber. Gracias.

Respuesta

25

locojays no funcionó para mí (OSX 10.7, Python 2.7.2 a través de homebrew), tuve que modificar el comando de la siguiente manera:

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

El "+ https" no funcionó para mí. Instalé con "sudo pip-2.7 install -e git: //github.com/matplotlib/matplotlib.git#egg=matplotlib" –

+0

¿Qué versión de pip estás usando? Estoy usando 'pip 1.0.2 de /usr/local/lib/python2.7/site-packages (python 2.7)' que obtuve al ejecutar 'pip --version' – staticfloat

+0

--version reports 'pip 1.0.1 de /usr/local/lib/python2.7/site-packages/pip-1.0.1-py2.7.egg ' –

1

con OSX 10.7, he utilizado el "Scipy Superpack" script de instalación, y ahora he matplotlib funcionando bien.

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

Se dio dos pasos y unos pocos minutos:

Instalar

Download Scipy Superpack Installer for OSX 10.7

instalar, abrir un terminal en el directorio que el script es localizado y llame:

$ sh install_superpack.sh

Se le pedirá su contraseña de administrador . Si ya ha instalado el gFortran actual, puede omitir ese paquete durante el proceso de instalación. Del mismo modo, la instalación requiere Git, por lo que se le pedirá que la instale si está instalando de forma remota.