Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

pip install matplotlib fails #808

Closed
diimdeep opened this Issue · 13 comments

9 participants

@diimdeep

latest osx, xcode
install python 2.7.2 with brew, then install pip for it

trying install matplotlib but no luck

https://gist.github.com/2259487

/usr/bin/clang -fno-strict-aliasing -Os -w -pipe -march=native -Qunused-arguments -fwrapv -DNDEBUG -g -O3 -Wall -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -I/usr/local/Cellar/python/2.7.2/lib/python2.7/site-packages/numpy/core/include -I. -I/usr/local/Cellar/python/2.7.2/lib/python2.7/site-packages/numpy/core/include -Isrc -Iagg24/include -I. -I/usr/local/Cellar/python/2.7.2/lib/python2.7/site-packages/numpy/core/include -I/usr/X11/include/freetype2 -I/usr/X11/include -I. -I/usr/local/Cellar/python/2.7.2/include/python2.7 -c src/backend_agg.cpp -o build/temp.macosx-10.4-x86_64-2.7/src/backend_agg.o

In file included from src/backend_agg.cpp:11:

In file included from src/_backend_agg.h:34:

agg24/include/agg_renderer_outline_aa.h:1368:45: error: binding of reference to type 'agg::line_profile_aa' to a value of type 'const agg::line_profile_aa' drops qualifiers

        line_profile_aa& profile() { return *m_profile; }

                                            ^~~~~~~~~~

1 error generated.

error: command '/usr/bin/clang' failed with exit status 1

----------------------------------------
Command /usr/local/Cellar/python/2.7.2/bin/python -c "import setuptools;__file__='/Users/dmitrywolf/build/matplotlib/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /var/folders/z4/vv2s3tc15sb0t8c3f8tr090h0000gn/T/pip-zM6U8D-record/install-record.txt failed with error code 1 in /Users/dmitrywolf/build/matplotlib
@diimdeep
git clone https://github.com/matplotlib/matplotlib.git
cd matplotlib
python setup.py build
python setup.py install
python
>>> import matplotlib
>>> print matplotlib.__version__
1.2.x
>>> print matplotlib.__file__
/usr/local/Cellar/python/2.7.2/lib/python2.7/site-packages/matplotlib/__init__.pyc
@staticfloat

I have the same error with pip, but when I clone from the git repo, I get a different libpng related error: https://gist.github.com/2269043

Same setup as diimdeep, osx 10.7, xcode 4.3, python 2.7.2 via homebrew, with pip installed for the python from homebrew.

@diimdeep

my xcode is 4.3.2

@dmcdougall
Collaborator

@diimdeep: The error you're getting with pip was a bug that was fixed and merged.

@staticfloat: Where does your install of libpng live?

@staticfloat

@dmcdougall; /usr/X11/include/libpng15

I created a homebrew formula to install libpng12 and link matplotlib with that, and this worked.

@dmcdougall
Collaborator

Hmmm. I have libpng14 installed via macports and matplotlib compiled successfully from that. Has anybody else had problems getting matplotlib to install with libpng15?

@veeks

os x 10.7.3
xcode 4.3.2
brew install python v2.7.3

matplotlib install (does not work)
pip - sudo pip install matplotlib
easy_install - sudo easy_install matplotlib
downloading 1.1.0 from source forge and execute 'sudo python setup.py install' - does not work

works:
git clone https://github.com/matplotlib/matplotlib.git
cd matplotlib
python setup.py build
python setup.py install

I did notice that git clone installs matplotlib version 1.2.x whereas the other methods were installing 1.1.x


error generated
agg24/include/agg_renderer_outline_aa.h:1368:45: error: binding of reference to
type 'agg::line_profile_aa' to a value of type 'const agg::line_profile_aa'
drops qualifiers
line_profile_aa& profile() { return *m_profile; }
^~~~~~~~~~
1 error generated.
error: command '/usr/bin/clang' failed with exit status 1

@damirv

This has been fixed, see #713

@pelson
Collaborator

When 1.1.1 is released, #713 means that this will no longer fail. Closing this issue.

@pelson pelson closed this
@roseperrone

I'm runnning matplotlib 1.4.x, yet I get this error:

ImportError: dlopen(/Library/Python/2.7/site-packages/matplotlib-1.4.x-py2.7-macosx-10.9-intel.egg/matplotlib/_png.so, 2): Library not loaded: /usr/local/lib/libpng15.15.dylib
Referenced from: /Library/Python/2.7/site-packages/matplotlib-1.4.x-py2.7-macosx-10.9-intel.egg/matplotlib/_png.so

I have libpng15 installed, but not libpng16.

@tacaswell
Owner

@roseperrone You should probably create a new issue for this as what ever was going wrong with 1.0 is probably not the same thing going wrong now.

If you think this is a bug in the library please create an issue, if you think it is configuration issues on your machine I would try the mpl mailing list of stackoverflow. In either case you should provide more information about how you installed/configured matplotlib and python. Getting the installation correct an Macs seems to be rather tricky.

@mdboom
Owner

This is probably related to the recently posted wheels. @mbrett

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.