0

I have tried installing matplotlib a number of ways and I was successful using - download through github, changing directory to folder, and running sudo python setup.py install. But, pyplot wasn't working so I uninstalled and I am trying to use pip and have been running into a ton of errors.

Megans-MacBook-Pro:~ MeganRCunninghan$ sudo pip install matplotlib
Downloading/unpacking matplotlib
  Running setup.py egg_info for package matplotlib
    ============================================================================
    Edit setup.cfg to change the build options

    BUILDING MATPLOTLIB
                matplotlib: yes [1.4.0]
                    python: yes [2.7.5 (default, Mar  9 2014, 22:15:05)  [GCC
                            4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)]]
                  platform: yes [darwin]

    REQUIRED DEPENDENCIES AND EXTENSIONS
                     numpy: yes [version 1.6.2]
                       six: yes [six was not found.]
                  dateutil: yes [using dateutil version 1.5]
                   tornado: yes [tornado was not found. It is required for the
                            WebAgg backend. pip/easy_install may attempt to
                            install it after matplotlib.]
                 pyparsing: yes [pyparsing was not found. It is required for
                            mathtext support. pip/easy_install may attempt to
                            install it after matplotlib.]
                     pycxx: yes [Couldn't import.  Using local copy.]
                    libagg: yes [pkg-config information for 'libagg' could not
                            be found. Using local copy.]
    Traceback (most recent call last):
      File "<string>", line 16, in <module>
      File "/tmp/pip-build/matplotlib/setup.py", line 154, in <module>
        result = package.check()
      File "setupext.py", line 940, in check
        if 'No such file or directory\ngrep:' in version:
    TypeError: argument of type 'NoneType' is not iterable
    Complete output from command python setup.py egg_info:
    ============================================================================

Edit setup.cfg to change the build options



BUILDING MATPLOTLIB

            matplotlib: yes [1.4.0]

                python: yes [2.7.5 (default, Mar  9 2014, 22:15:05)  [GCC

                        4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)]]

              platform: yes [darwin]



REQUIRED DEPENDENCIES AND EXTENSIONS

                 numpy: yes [version 1.6.2]

                   six: yes [six was not found.]

              dateutil: yes [using dateutil version 1.5]

               tornado: yes [tornado was not found. It is required for the

                        WebAgg backend. pip/easy_install may attempt to

                        install it after matplotlib.]

             pyparsing: yes [pyparsing was not found. It is required for

                        mathtext support. pip/easy_install may attempt to

                        install it after matplotlib.]

                 pycxx: yes [Couldn't import.  Using local copy.]

                libagg: yes [pkg-config information for 'libagg' could not

                        be found. Using local copy.]

Traceback (most recent call last):

  File "<string>", line 16, in <module>

  File "/tmp/pip-build/matplotlib/setup.py", line 154, in <module>

    result = package.check()

  File "setupext.py", line 940, in check

    if 'No such file or directory\ngrep:' in version:

TypeError: argument of type 'NoneType' is not iterable

----------------------------------------
Command python setup.py egg_info failed with error code 1 in /tmp/pip-build/matplotlib
Storing complete log in /Users/MeganRCunninghan/Library/Logs/pip.log

when I go to python and I type

>>import matplot lib 

it works but when I want matplotlib.pyplot I get an error:

>>> import matplotlib.pyplot as plt

Traceback (most recent call last):
  File "<pyshell#3>", line 1, in <module>
    import matplotlib.pyplot as plt
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/pyplot.py", line 26, in <module>
    from matplotlib.figure import Figure, figaspect
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/figure.py", line 24, in <module>
    import matplotlib.artist as martist
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/artist.py", line 7, in <module>
    from transforms import Bbox, IdentityTransform, TransformedBbox, \
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/transforms.py", line 35, in <module>
    from matplotlib._path import (affine_transform, count_bboxes_overlapping_bbox,
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/_path.so, 2): no suitable image found.  Did find:
    /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/_path.so: no matching architecture in universal wrapper

2 Answers 2

1

I highly recommend you install Anaconda. It solves a lot of the issues that comes up when installing scientific related modules.

Sign up to request clarification or add additional context in comments.

1 Comment

thanks! I fixed the issue, but I will check this out for future issues. :)
0

So I fixed the problem: Uninstalled matplotlib manually by located install directory in python:

>>> import matplotlib
>>> matplotlib.__file__

Then I went to my finder and located the folder using CMD+Shift+G and pasted the file location given. Selected the matplotlib file and deleted. Went to cmd line and typed

sudo pip install matplotlib

Now it works. Also, before running pip I installed xcode and fixed the hang up between clang and lipo as well using these instructions: Install xcode, go to termina -

 xcode-select --install

Install Command Line tools at: https://developer.apple.com/downloads/index.action?=command%20line%20tools#

Go to terminal:

sudo mv /usr/bin/lipo /usr/bin/lipo.orig sudo 
ln -s /Library/Developer/CommandLineTools/usr/bin/lipo /usr/bin

Install Pip if you dont have it:

sudo su 
easy_install pip

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.