|
From: Uri L. <las...@mi...> - 2010-12-13 21:46:05
|
Hi all, I am trying to install matplotlib on a MacMini Intel Core 2 Duo with a clean install of Mac OS X 10.6. I am using python 2.7 that I built from source using the homebrew package installer. I also installed numpy 1.5.1 from source, using the following environment variables: export MACOSX_DEPLOYMENT_TARGET=10.6 export CFLAGS="-arch i386 -arch x86_64" export FFLAGS="-m32 -m64" export LDFLAGS="-Wall -undefined dynamic_lookup -bundle -arch i386 -arch x86_64 -framework Accelerate" I also used gfortran 4.2.3 precompiled that I downloaded from http://r.research.att.com/tools/ NOTE: I previously performed this whole install process on a brand new MacBook Air, and it worked without a problem. I ran numpy.test() and got the following output: In [4]: numpy.test() Running unit tests for numpy NumPy version 1.5.1 NumPy is installed in /usr/local/Cellar/python/2.7.1/lib/python2.7/site-packages/numpy Python version 2.7.1 (r271:86832, Dec 13 2010, 14:21:05) [GCC 4.2.1 (Apple Inc. build 5664)] nose version 0.11.4 [...snip...] Ran 3006 tests in 18.696s OK (KNOWNFAIL=4, SKIP=1) Out[4]: <nose.result.TextTestResult run=3006 errors=0 failures=0> Also, when I try to import numpy.core.multiarray, I get no errors. Finally, I cloned the latest GitHub MPL and set make.osx to be the following (note: changed pyversion, pngfamily, pngversion, deployment target, and the FFLAGS variable): # build mpl into a local install dir with # PREFIX=/Users/jdhunter/dev make -f make.osx fetch deps mpl_install MPLVERSION=1.0rc1 PYVERSION=2.7 PYTHON=python${PYVERSION} ZLIBVERSION=1.2.3 PNGFAMILY=12 PNGVERSION=1.2.44 FREETYPEVERSION=2.3.11 MACOSX_DEPLOYMENT_TARGET=10.6 OSX_SDK_VER=10.6 ARCH_FLAGS="-arch i386 -arch x86_64" ## You shouldn't need to configure past this point PKG_CONFIG_PATH="${PREFIX}/lib/pkgconfig" CFLAGS="-arch i386 -arch x86_64 -I${PREFIX}/include -I${PREFIX}/include/freetype2 -isysroot /Developer/SDKs/MacOSX${OSX_SDK_VER}.sdk" LDFLAGS="-arch i386 -arch x86_64 -L${PREFIX}/lib -syslibroot,/Developer/SDKs/MacOSX${OSX_SDK_VER}.sdk" FFLAGS="-arch i386 -arch x86_64" The install seems to go fine. I can import matplotlib. But when I import matplotlib.pyplot, I get the following: In [2]: import matplotlib.pyplot --------------------------------------------------------------------------- RuntimeError Traceback (most recent call last) RuntimeError: module compiled against ABI version 2000000 but this version of numpy is 1000009 --------------------------------------------------------------------------- ImportError Traceback (most recent call last) /Users/laserson/<ipython console> in <module>() /Users/laserson/matplotlib/lib/python2.7/site-packages/matplotlib/pyplot.py in <module>() 21 from matplotlib.cbook import dedent, silent_list, is_string_like, is_numlike 22 from matplotlib import docstring ---> 23 from matplotlib.figure import Figure, figaspect 24 from matplotlib.backend_bases import FigureCanvasBase 25 from matplotlib.image import imread as _imread /Users/laserson/matplotlib/lib/python2.7/site-packages/matplotlib/figure.py in <module>() 14 import numpy as np 15 ---> 16 import artist 17 from artist import Artist, allow_rasterization 18 from axes import Axes, SubplotBase, subplot_class_factory /Users/laserson/matplotlib/lib/python2.7/site-packages/matplotlib/artist.py in <module>() 4 import matplotlib.cbook as cbook 5 from matplotlib import docstring, rcParams ----> 6 from transforms import Bbox, IdentityTransform, TransformedBbox, TransformedPath 7 from path import Path 8 /Users/laserson/matplotlib/lib/python2.7/site-packages/matplotlib/transforms.py in <module>() 32 import numpy as np 33 from numpy import ma ---> 34 from matplotlib._path import affine_transform 35 from numpy.linalg import inv 36 ImportError: numpy.core.multiarray failed to import It is strange because when I import numpy.core.multiarray, I have no problems. It also raises a RuntimeError, yelling about an ABI incompatibility. Does anyone know how to solve this problem? I was able to get this to work on another computer..strange that it fails now. Thanks! Uri ................................................................................... Uri Laserson Graduate Student, Biomedical Engineering Harvard-MIT Division of Health Sciences and Technology M +1 917 742 8019 las...@mi... |