Failed pip install on OSX

Hi,

Congratulations on the new release.

I just tried installing in a fresh installation of Python 2.7 from Python.org

Am I right in thinking the recommended method is:

    pip install matplotlib

? I did this, and then:

import matplotlib.pyplot as plt

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/pyplot.py",
line 24, in <module>
    import matplotlib.colorbar
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/colorbar.py",
line 29, in <module>
    import matplotlib.collections as collections
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/collections.py",
line 23, in <module>
    import matplotlib.backend_bases as backend_bases
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/backend_bases.py",
line 50, in <module>
    import matplotlib.textpath as textpath
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/textpath.py",
line 14, in <module>
    from matplotlib.mathtext import MathTextParser
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/mathtext.py",
line 62, in <module>
    import matplotlib._png as _png
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/_png.so,
2): Library not loaded: /usr/X11/lib/libpng12.0.dylib
  Referenced from:
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/_png.so
  Reason: Incompatible library version: _png.so requires version
42.0.0 or later, but libpng12.0.dylib provides version 36.0.0

There were no previous versions of matplotlib installed. This on OSX 10.6:

Python 2.7.5 just installed from python.org
X11 installed from the Apple installation disks for 10.6 before `pip
install matplotlib`
No homebrew etc

Any hints about how I should debug this further?

Thanks a lot for any help,

Matthew

I was able to install numpy 1.7.1 and matplotlib 1.30 under OS X 10.6.8 with X11 version XQuartz 2.3.6 (xorg-server 1.4.2-apple56) and python 2.7.5 64-bit from python.org using pip 1.4.

Have you tried running Software Update? If you installed X11 after updating to 10.6.8 you can run the combo updater ( Mac OS X 10.6.8 Update Combo v1.1 ) to get the latest X11. Alternately, you could try installing XQuartz from XQuartz

hth,
Scott

···

On Aug 4, 2013, at 4:47 PM, Matthew Brett <matthew.brett@...1016...> wrote:

Hi,

Congratulations on the new release.

I just tried installing in a fresh installation of Python 2.7 from Python.org

Am I right in thinking the recommended method is:

   pip install matplotlib

? I did this, and then:

import matplotlib.pyplot as plt

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/pyplot.py",
line 24, in <module>
   import matplotlib.colorbar
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/colorbar.py",
line 29, in <module>
   import matplotlib.collections as collections
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/collections.py",
line 23, in <module>
   import matplotlib.backend_bases as backend_bases
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/backend_bases.py",
line 50, in <module>
   import matplotlib.textpath as textpath
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/textpath.py",
line 14, in <module>
   from matplotlib.mathtext import MathTextParser
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/mathtext.py",
line 62, in <module>
   import matplotlib._png as _png
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/_png.so,
2): Library not loaded: /usr/X11/lib/libpng12.0.dylib
Referenced from:
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/_png.so
Reason: Incompatible library version: _png.so requires version
42.0.0 or later, but libpng12.0.dylib provides version 36.0.0

There were no previous versions of matplotlib installed. This on OSX 10.6:

Python 2.7.5 just installed from python.org
X11 installed from the Apple installation disks for 10.6 before `pip
install matplotlib`
No homebrew etc

Any hints about how I should debug this further?

Thanks a lot for any help,

Matthew

Hi,

Hi,

Congratulations on the new release.

I just tried installing in a fresh installation of Python 2.7 from Python.org

Am I right in thinking the recommended method is:

   pip install matplotlib

? I did this, and then:

import matplotlib.pyplot as plt

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/pyplot.py",
line 24, in <module>
   import matplotlib.colorbar
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/colorbar.py",
line 29, in <module>
   import matplotlib.collections as collections
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/collections.py",
line 23, in <module>
   import matplotlib.backend_bases as backend_bases
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/backend_bases.py",
line 50, in <module>
   import matplotlib.textpath as textpath
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/textpath.py",
line 14, in <module>
   from matplotlib.mathtext import MathTextParser
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/mathtext.py",
line 62, in <module>
   import matplotlib._png as _png
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/_png.so,
2): Library not loaded: /usr/X11/lib/libpng12.0.dylib
Referenced from:
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/_png.so
Reason: Incompatible library version: _png.so requires version
42.0.0 or later, but libpng12.0.dylib provides version 36.0.0

There were no previous versions of matplotlib installed. This on OSX 10.6:

Python 2.7.5 just installed from python.org
X11 installed from the Apple installation disks for 10.6 before `pip
install matplotlib`
No homebrew etc

Any hints about how I should debug this further?

Thanks a lot for any help,

Matthew

I was able to install numpy 1.7.1 and matplotlib 1.30 under OS X 10.6.8 with X11 version XQuartz 2.3.6 (xorg-server 1.4.2-apple56) and python 2.7.5 64-bit from python.org using pip 1.4.

Have you tried running Software Update? If you installed X11 after updating to 10.6.8 you can run the combo updater ( Mac OS X 10.6.8 Update Combo v1.1 ) to get the latest X11. Alternately, you could try installing XQuartz from XQuartz

Yes, the system was up to date before I installed matplotlib. Just
to check my failing memory, I checked for updates (none), reinstalled
and got the same answer.

The combo updater looks like it's a fast track to the same outcome as
Software update - is it something different?

If Matplotlib is only expected to work for the Quartz installs - is it
worth trying to detect that and warn / error at install time?

Cheers,

Matthew

···

On Sun, Aug 4, 2013 at 7:26 PM, Scott Lasley <slasley@...2425...> wrote:

On Aug 4, 2013, at 4:47 PM, Matthew Brett <matthew.brett@...1016...> wrote:

Logically, XQuartz should not be needed at all; mpl on the mac does not require X11. It looks like XQuartz is an accidental dependency, as a way to get access to a suitable libpng.

A link from the libpng web site led to this:
http://ethan.tira-thompson.com/Mac_OS_X_Ports.html
which might be a viable alternative.

Eric

···

On 2013/08/05 10:43 AM, Matthew Brett wrote:

If Matplotlib is only expected to work for the Quartz installs - is it
worth trying to detect that and warn / error at install time?

Hi,

Hi,

Congratulations on the new release.

I just tried installing in a fresh installation of Python 2.7 from Python.org

Am I right in thinking the recommended method is:

  pip install matplotlib

? I did this, and then:

import matplotlib.pyplot as plt

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/pyplot.py",
line 24, in <module>
  import matplotlib.colorbar
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/colorbar.py",
line 29, in <module>
  import matplotlib.collections as collections
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/collections.py",
line 23, in <module>
  import matplotlib.backend_bases as backend_bases
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/backend_bases.py",
line 50, in <module>
  import matplotlib.textpath as textpath
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/textpath.py",
line 14, in <module>
  from matplotlib.mathtext import MathTextParser
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/mathtext.py",
line 62, in <module>
  import matplotlib._png as _png
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/_png.so,
2): Library not loaded: /usr/X11/lib/libpng12.0.dylib
Referenced from:
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/_png.so
Reason: Incompatible library version: _png.so requires version
42.0.0 or later, but libpng12.0.dylib provides version 36.0.0

There were no previous versions of matplotlib installed. This on OSX 10.6:

Python 2.7.5 just installed from python.org
X11 installed from the Apple installation disks for 10.6 before `pip
install matplotlib`
No homebrew etc

Any hints about how I should debug this further?

Thanks a lot for any help,

Matthew

I was able to install numpy 1.7.1 and matplotlib 1.30 under OS X 10.6.8 with X11 version XQuartz 2.3.6 (xorg-server 1.4.2-apple56) and python 2.7.5 64-bit from python.org using pip 1.4.

Have you tried running Software Update? If you installed X11 after updating to 10.6.8 you can run the combo updater ( Mac OS X 10.6.8 Update Combo v1.1 ) to get the latest X11. Alternately, you could try installing XQuartz from XQuartz

Yes, the system was up to date before I installed matplotlib. Just
to check my failing memory, I checked for updates (none), reinstalled
and got the same answer.

The combo updater looks like it's a fast track to the same outcome as
Software update - is it something different?

I don't remember if Software Update detects updates to X11. What version of X11 are you running? The version on the Snow Leopard install disks, 2.3.4, is older than version 2.3.6 installed by the combo updater. As far as I know there is no standalone X11 2.3.6 updater for Snow Leopard. You'll have to re-install the security updates that came out after the combo updater was released if you use it, which is a bit of a pain. According to otool -L, the libpng12.0.dylib installed with X11 2.3.6 is version 45, compatibility version 45, so it should work with matplotlib.

If you don't want to run the combo updater because of possible side effects or install XQuartz you can download libpng from LIBPNG: PNG reference library - Browse Files at SourceForge.net, unpack it and do the standard ./configure, make, sudo make install to install it in /usr/local/lib. setup.py should find it there.

hth,
Scott

···

On Aug 5, 2013, at 4:43 PM, Matthew Brett <matthew.brett@...1016...> wrote:

On Sun, Aug 4, 2013 at 7:26 PM, Scott Lasley <slasley@...2425...> wrote:

On Aug 4, 2013, at 4:47 PM, Matthew Brett <matthew.brett@...1016...> wrote:

If Matplotlib is only expected to work for the Quartz installs - is it
worth trying to detect that and warn / error at install time?

Cheers,

Matthew

Hi,

Hi,

Hi,

Congratulations on the new release.

I just tried installing in a fresh installation of Python 2.7 from Python.org

Am I right in thinking the recommended method is:

  pip install matplotlib

? I did this, and then:

import matplotlib.pyplot as plt

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/pyplot.py",
line 24, in <module>
  import matplotlib.colorbar
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/colorbar.py",
line 29, in <module>
  import matplotlib.collections as collections
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/collections.py",
line 23, in <module>
  import matplotlib.backend_bases as backend_bases
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/backend_bases.py",
line 50, in <module>
  import matplotlib.textpath as textpath
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/textpath.py",
line 14, in <module>
  from matplotlib.mathtext import MathTextParser
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/mathtext.py",
line 62, in <module>
  import matplotlib._png as _png
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/_png.so,
2): Library not loaded: /usr/X11/lib/libpng12.0.dylib
Referenced from:
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/_png.so
Reason: Incompatible library version: _png.so requires version
42.0.0 or later, but libpng12.0.dylib provides version 36.0.0

There were no previous versions of matplotlib installed. This on OSX 10.6:

Python 2.7.5 just installed from python.org
X11 installed from the Apple installation disks for 10.6 before `pip
install matplotlib`
No homebrew etc

Any hints about how I should debug this further?

Thanks a lot for any help,

Matthew

I was able to install numpy 1.7.1 and matplotlib 1.30 under OS X 10.6.8 with X11 version XQuartz 2.3.6 (xorg-server 1.4.2-apple56) and python 2.7.5 64-bit from python.org using pip 1.4.

Have you tried running Software Update? If you installed X11 after updating to 10.6.8 you can run the combo updater ( Mac OS X 10.6.8 Update Combo v1.1 ) to get the latest X11. Alternately, you could try installing XQuartz from XQuartz

Yes, the system was up to date before I installed matplotlib. Just
to check my failing memory, I checked for updates (none), reinstalled
and got the same answer.

The combo updater looks like it's a fast track to the same outcome as
Software update - is it something different?

I don't remember if Software Update detects updates to X11. What version of X11 are you running? The version on the Snow Leopard install disks, 2.3.4, is older than version 2.3.6 installed by the combo updater.

Sorry - I am afraid I installed the combo updater over the existing
X11 before I read your email properly, so I don't know what version I
had before.

As far as I know there is no standalone X11 2.3.6 updater for Snow Leopard. You'll have to re-install the security updates that came out after the combo updater was released if you use it, which is a bit of a pain. According to otool -L, the libpng12.0.dylib installed with X11 2.3.6 is version 45, compatibility version 45, so it should work with matplotlib.

Yes, that does work thanks.

If you don't want to run the combo updater because of possible side effects or install XQuartz you can download libpng from LIBPNG: PNG reference library - Browse Files at SourceForge.net, unpack it and do the standard ./configure, make, sudo make install to install it in /usr/local/lib. setup.py should find it there.

So, to summarize, pip install for matplotlib will fail on bare-bones
OSX 10.6 unless you do one of:

* Run the combo updater
* Install Quartz X11
* Build your own libpng in /usr/local

Is that a reasonable list?

Is there any way to check for this problem and warn / error at build
time with instructions?

Thanks a lot for the help,

Matthew

···

On Mon, Aug 5, 2013 at 4:36 PM, Scott Lasley <slasley@...2425...> wrote:

On Aug 5, 2013, at 4:43 PM, Matthew Brett <matthew.brett@...1016...> wrote:

On Sun, Aug 4, 2013 at 7:26 PM, Scott Lasley <slasley@...2425...> wrote:

On Aug 4, 2013, at 4:47 PM, Matthew Brett <matthew.brett@...1016...> wrote: