Python: free, freedom, frustration

I managed to break my python installation; one of the things I hate about python is how fragile it seems to be. I’m sure it’s my fault, and that I do stupid things without knowing it, but I’ve never managed to break my Matlab install aside from upgrading to a new OS that isn’t compatible with the antique Matlab I was running. Of course, this complete lack of centralized control (or even information) is part of what I like about python, when I’m championing it’s free price and huge user community. I just wish I had some python expert buddies who could teach me the bigger picture so I wouldn’t keep breaking things.

I’m not sure what happened, but between one minute and the next all my scripts stopped working; I suddenly couldn’t import matplotlib. Then, I wasn’t able to install it. I got the “missing freetype” error (below), and no amount of soft links (here, here, or here) to where freetype was installed would help. My problem was that I don’t know where pip is LOOKING for freetype, so I don’t know where to put the softlinks. Even trying to build from code didn’t work (I even customized the setup.cfg to point directly to my freetype install)! Out of frustration I updated pip itself (maybe pip forgot where freetype was? I couldn’t think of another way to get pip to “re-index” my path???) and, voila, matplotlib install worked!

So I’m posting this in case anyone else is stuck in a hole.

air2:freetype-2.5.3 agrant$ sudo pip install matplotlib
Downloading/unpacking matplotlib
Downloading matplotlib-1.4.2.tar.gz (50.1MB): 50.1MB downloaded
Running setup.py egg_info for package matplotlib
IMPORTANT WARNING:
pkg-config is not installed.
matplotlib may not be able to find some of its dependencies
============================================================================
Edit setup.cfg to change the build options

BUILDING MATPLOTLIB
matplotlib: yes [1.4.2]
python: yes [2.7.6 (default, Sep  9 2014, 15:04:36)  [GCC
4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)]]
platform: yes [darwin]

REQUIRED DEPENDENCIES AND EXTENSIONS
numpy: yes [version 1.8.0rc1]
six: yes [using six version 1.4.1]
dateutil: yes [using dateutil version 2.2]
pytz: yes [using pytz version 2013b]
tornado: yes [using tornado version 3.2.1]
pyparsing: yes [using pyparsing version 2.0.1]
pycxx: yes [Couldn’t import.  Using local copy.]
libagg: yes [pkg-config information for ‘libagg’ could not
be found. Using local copy.]
freetype: no  [The C/C++ header for freetype2 (ft2build.h)
could not be found.  You may need to install the
development package.]
png: yes [version 1.5.18]
qhull: yes [pkg-config information for ‘qhull’ could not be
found. Using local copy.]

OPTIONAL SUBPACKAGES
sample_data: yes [installing]
toolkits: yes [installing]
tests: yes [nose 0.11.1 or later is required to run the
matplotlib test suite.  pip/easy_install may attempt
to install it after matplotlib. / using mock 1.0.1]
toolkits_tests: yes [nose 0.11.1 or later is required to run the
matplotlib test suite.  pip/easy_install may attempt
to install it after matplotlib. / using mock 1.0.1]

OPTIONAL BACKEND EXTENSIONS
macosx: yes [installing, darwin]
qt5agg: no  [PyQt5 not found]
qt4agg: no  [PyQt4 not found]
pyside: no  [PySide not found]
gtk3agg: no  [Requires pygobject to be installed.]
gtk3cairo: no  [Requires cairocffi or pycairo to be installed.]
gtkagg: no  [Requires pygtk]
tkagg: yes [installing, version 81008]
wxagg: no  [requires wxPython]
gtk: no  [Requires pygtk]
agg: yes [installing]
cairo: no  [cairocffi or pycairo not found]
windowing: no  [Microsoft Windows only]

OPTIONAL LATEX DEPENDENCIES
dvipng: no
ghostscript: no
latex: no
pdftops: no

============================================================================
* The following required packages can not be built:
* freetype
Complete output from command python setup.py egg_info:
IMPORTANT WARNING:

pkg-config is not installed.

matplotlib may not be able to find some of its dependencies

============================================================================

Edit setup.cfg to change the build options

BUILDING MATPLOTLIB

matplotlib: yes [1.4.2]

python: yes [2.7.6 (default, Sep  9 2014, 15:04:36)  [GCC

4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)]]

platform: yes [darwin]

REQUIRED DEPENDENCIES AND EXTENSIONS

numpy: yes [version 1.8.0rc1]

six: yes [using six version 1.4.1]

dateutil: yes [using dateutil version 2.2]

pytz: yes [using pytz version 2013b]

tornado: yes [using tornado version 3.2.1]

pyparsing: yes [using pyparsing version 2.0.1]

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

libagg: yes [pkg-config information for ‘libagg’ could not

be found. Using local copy.]

freetype: no  [The C/C++ header for freetype2 (ft2build.h)

could not be found.  You may need to install the

development package.]

png: yes [version 1.5.18]

qhull: yes [pkg-config information for ‘qhull’ could not be

found. Using local copy.]

OPTIONAL SUBPACKAGES

sample_data: yes [installing]

toolkits: yes [installing]

tests: yes [nose 0.11.1 or later is required to run the

matplotlib test suite.  pip/easy_install may attempt

to install it after matplotlib. / using mock 1.0.1]

toolkits_tests: yes [nose 0.11.1 or later is required to run the

matplotlib test suite.  pip/easy_install may attempt

to install it after matplotlib. / using mock 1.0.1]

OPTIONAL BACKEND EXTENSIONS

macosx: yes [installing, darwin]

qt5agg: no  [PyQt5 not found]

qt4agg: no  [PyQt4 not found]

pyside: no  [PySide not found]

gtk3agg: no  [Requires pygobject to be installed.]

gtk3cairo: no  [Requires cairocffi or pycairo to be installed.]

gtkagg: no  [Requires pygtk]

tkagg: yes [installing, version 81008]

wxagg: no  [requires wxPython]

gtk: no  [Requires pygtk]

agg: yes [installing]

cairo: no  [cairocffi or pycairo not found]

windowing: no  [Microsoft Windows only]

OPTIONAL LATEX DEPENDENCIES

dvipng: no

ghostscript: no

latex: no

pdftops: no

============================================================================

* The following required packages can not be built:

* freetype

—————————————-
Cleaning up…
Command python setup.py egg_info failed with error code 1 in /private/tmp/pip_build_root/matplotlib
Storing complete log in /Users/agrant/Library/Logs/pip.log

Advertisements
Previous Post
Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: