2011-08-04 36 views
14

Dưới đây là những gì tôi cố gắng làm:Làm thế nào để cài đặt Matplotlib trên Mac 10.7 trong 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 

Xin hãy giúp tôi. Nếu bạn cần bất kỳ thông tin bổ sung nào, vui lòng cho tôi biết. Cảm ơn bạn.

Trả lời

8

chỉ làm

pips đối install -e https://github.com/matplotlib/matplotlib.git matplotlib

hoặc bản sao và sau đó cài đặt

hoặc có một cái nhìn @

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

nhưng nó không phải là một vấn đề sư tử chỉ là lỗi python 2.7.2. có cùng một vấn đề trên một máy báo đồng nghiệp tuyết

giả sử bạn đang sử dụng brew

hy vọng điều này giúp

25

locojays dòng không làm việc cho tôi (OSX 10.7, Python 2.7.2 qua homebrew), Tôi đã phải sửa đổi lệnh như sau:

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

"+ https" không hoạt động đối với tôi. Tôi đã cài đặt với "sudo pip-2.7 install -e git: //github.com/matplotlib/matplotlib.git#egg=matplotlib" –

+0

Bạn đang sử dụng phiên bản pip nào? Tôi đang sử dụng 'pip 1.0.2 từ /usr/local/lib/python2.7/site-packages (python 2.7)' mà tôi nhận được từ việc chạy 'pip --version' – staticfloat

+0

- báo cáo chuyển đổi 'pip 1.0.1 từ /usr/local/lib/python2.7/site-packages/pip-1.0.1-py2.7.egg ' –

1

Với OSX 10.7, tôi đã sử dụng tập lệnh cài đặt "Scipy Superpack" và bây giờ tôi đã làm việc tốt.

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

Phải mất hai bước và một vài phút:

Install

Download Scipy Superpack Installer for OSX 10.7

Để cài đặt, mở một thiết bị đầu cuối trong thư mục mà kịch bản là đặt và gọi:

$ sh install_superpack.sh

Bạn sẽ được nhắc cho quản trị viên mật khẩu. Nếu bạn đã cài đặt gFortran hiện tại, bạn có thể bỏ qua gói đó trong quá trình cài đặt. Tương tự, cài đặt yêu cầu Git, vì vậy bạn sẽ được nhắc cài đặt nó nếu bạn đang cài đặt từ xa.

Các vấn đề liên quan