0.84 Strange Install Problem

Hello again- Well, I think I have everything working,

    > thanks to your magicness. I had to manually set the
    > NUMERIX string to "Numeric", because even though I
    > had the latest python-numarray and
    > python-numarray-ext packages, setup.py still couldn't
    > find my numarray files. Observe:

Great! I don't know why you had this numarray problem but it may be
because the dev headers aren't installed in the debian package. If
you want it, it is trivial to compile and install from source. Then
you would need to recompile matplotlib so it would pick up the
numarray extension code.

In any case, glad you have something working!

For future reference, I like to keep mpl discussions on list unless
they get bogged down into machine specific technical minutae because
others will benefit from having this information archived.

CC-ing to list.

Cheers,
JDH

···

cmutel@...833...:~/src/matplotlib-0.84 $ sudo python

    > setup.py build TKAgg requires TkInter running build
    > running build_py running build_ext building
    > 'matplotlib._na_transforms' extension gcc -pthread
    > -fno-strict-aliasing -DNDEBUG -g -O3 -Wall
    > -Wstrict-prototypes -fPIC -Isrc -I. -I
    > -I/usr/local/include -I/usr/include
    > -I. -I/usr/local/include/python2.4 -c
    > src/_na_transforms.cpp -o
    > build/temp.linux-i686-2.4/src/_na_transforms.o
    > -DNUMARRAY=1 In file included from
    > /usr/local/include/python2.4/Python.h:8, from
    > CXX/Objects.hxx:9, from CXX/Extensions.hxx:19, from
    > src/_transforms.h:12, from src/_na_transforms.cpp:2:
    > /usr/local/include/python2.4/pyconfig.h:835:1:
    > warning: "_POSIX_C_SOURCE" redefined In file included
    > from
    > /usr/include/c++/3.3/i486-linux/bits/os_defines.h:39,
    > from
    > /usr/include/c++/3.3/i486-linux/bits/c++config.h:35,
    > from /usr/include/c++/3.3/functional:53, from
    > src/_na_transforms.cpp:1:
    > /usr/include/features.h:131:1: warning: this is the
    > location of the previous definition
    > src/_na_transforms.cpp:6:35: numarray/arrayobject.h:
    > No such file or directory src/_na_transforms.cpp: In
    > member function `Py::Object
    > Bbox::update_numerix(const Py::Tuple&)':
    > src/_na_transforms.cpp:436: error: `PyArrayObject'
    > undeclared (first use this function)
    > src/_na_transforms.cpp:436: error: (Each undeclared
    > identifier is reported only once for each function it
    > appears in.) src/_na_transforms.cpp:436: error: `x'
    > undeclared (first use this function)
    > src/_na_transforms.cpp:436: error: parse error before
    > `)' token src/_na_transforms.cpp:442: error: `y'
    > undeclared (first use this function)
    > src/_na_transforms.cpp:442: error: parse error before
    > `)' token src/_na_transforms.cpp: In member function
    > `Py::Object Transformation::numerix_x_y(const
    > Py::Tuple&, const Py::Dict&)':
    > src/_na_transforms.cpp:810: error: parse error before
    > `)' token src/_na_transforms.cpp:816: error: parse
    > error before `)' token src/_na_transforms.cpp:841:
    > error: `retx' undeclared (first use this function)
    > src/_na_transforms.cpp:841: error: parse error before
    > `)' token src/_na_transforms.cpp:848: error: `rety'
    > undeclared (first use this function)
    > src/_na_transforms.cpp:848: error: parse error before
    > `)' token src/_na_transforms.cpp: In member function
    > `Py::Object
    > Transformation::nonlinear_only_numerix(const
    > Py::Tuple&, const Py::Dict&)':
    > src/_na_transforms.cpp:895: error: parse error before
    > `)' token src/_na_transforms.cpp:901: error: parse
    > error before `)' token src/_na_transforms.cpp:917:
    > error: parse error before `)' token
    > src/_na_transforms.cpp:924: error: parse error before
    > `)' token src/_na_transforms.cpp:932: error:
    > `retmask' undeclared (first use this function)
    > src/_na_transforms.cpp:935: error: parse error before
    > `)' token src/_na_transforms.cpp: In function `void
    > init_na_transforms()': src/_na_transforms.cpp:1978:
    > error: `import_array' undeclared (first use this
    > function) error: command 'gcc' failed with exit
    > status 1

    > ...

    > cmutel@...833...:/usr/local/lib/python2.4/site-packages     > ls /usr/include/python2\.4/Numeric/ arrayobject\.h     > f2c\.h ranlib\.h ufuncobject\.h     > cmutel@\.\.\.833\.\.\.:/usr/local/lib/python2\.4/site\-packages
    > ls /usr/include/python2.4/numarray/ arraybase.h
    > ieeespecial.h libteacup.h numconfig.h arrayobject.h
    > libnumarray.h numarray.h nummacro.h cfunc.h
    > libnumeric.h numcomplex.h tc.h

    > And of course Numeric built fine.

    > Ultimately, of course, this doesn't matter, because I
    > can import matplotlib and pyalb as * without a
    > problem. I had a presentation yesterday, and I had to
    > export my data, and then import it on a clean build
    > of matplotlib on my windows machine, which wasn't
    > much fun.

    > Kepp on rockin'-

    > Chris Mutel

    > On 10/6/05, Christopher Mutel <cmutel@...287...> > wrote:
    >> John-
    >>
    >> I have been following the matplotlib mailing list for a while,
    >> and you have been unfailing kind and generous with your time in
    >> every message I have seen. I think what you're doing is damn
    >> great.
    >>
    >> I actually already did to install your python package - I got
    >> errors with PyUnicodeUCS4... after seraching around on the net,
    >> this seems to be an error that is not resolvable without
    >> recompiliing either python or... wait for
    >> it... matplotlib. Here is the actual error code I get:
    >>
    >> >>> from pylab import *
    >> /usr/lib/python2.4/site-packages/matplotlib/__init__.py:792:
    >> UserWarning: Could not find matplotlibrc; using defaults
    >> warnings.warn('Could not find matplotlibrc; using defaults')
    >> /usr/lib/python2.4/site-packages/matplotlib/__init__.py:813:
    >> UserWarning: could not find rc file; returning defaults
    >> warnings.warn(message) Traceback (most recent call last): File
    >> "<stdin>", line 1, in ? File
    >> "/usr/local/lib/python2.4/site-packages/pylab.py", line 1, in ?
    >> from matplotlib.pylab import * File
    >> "/usr/local/lib/python2.4/site-packages/pylab.py", line 198, in
    >> ?
    >>
    >> File
    >> "/home/jdhunter/debs/matplotlib/usr/lib/python2.4/site-packages/matplotlib/axes.py",
    >> line 15, in ? File
    >> "/home/jdhunter/debs/matplotlib/usr/lib/python2.4/site-packages/matplotlib/axis.py",
    >> line 25, in ? File
    >> "/home/jdhunter/debs/matplotlib/usr/lib/python2.4/site-packages/matplotlib/font_manager.py",
    >> line 39, in ? ImportError:
    >> /usr/lib/python2.4/site-packages/matplotlib/ft2font.so:
    >> undefined symbol: PyUnicodeUCS4_AsUnicode
    >>
    >> Is there any reason that this should happen? I don't know. I
    >> also don't know why apt doesn't install a matplotlibrc file.
    >>
    >> I am pretty sure that my problems are the result of my having a
    >> machine that is out of whack in some respects. I installed
    >> python 2.4 form the standard Ubuntu package, and there is no
    >> reason that my package should break matplotlib while yours
    >> didn't. I don't know enough about linux to fit everything - on
    >> the other hand, the day after I installed Ubuntu the CD-Rom
    >> failed on my Linux box, so I don't have any way of
    >> re-installing everything.
    >>
    >> I will try what you told me.
    >>
    >> -Chris
    >>
    >> On 10/6/05, John Hunter <jdhunter@...4...> wrote:
    >> > >>>>> "Christopher" == Christopher Mutel <cmutel@...287...>
    >> writes:
    >> >
    >> > > I'm having trouble compiling 0.84 on Python 2.4
    >> / > Christopher> Ubuntu Hoary (5.04). It seems like when GCC
    >> tries to > Christopher> build ft2font it can't find the two
    >> files referenced > Christopher> in CXX/extensions.hxx and
    >> CXX/objects.hxx.
    >> >
    >> > Do you mean CXX/Extensions.hxx and CXX/Objects.hxx? I just
    >> untarred > the 0.84 distribution and they are certainly there
    >> >
    >> > peds-pc311:/var/tmp/matplotlib-0.84> ls CXX/ > Config.hxx
    >> cxxsupport.cxx IndirectPythonInterface.cxx Version.hxx >
    >> cxxextensions.c Exception.hxx IndirectPythonInterface.hxx >
    >> cxx_extensions.cxx Extensions.hxx Objects.hxx
    >> >
    >> > Are you running setup.py from the dir in which it resides, eg
    >> >
    >> > > python setup.py build
    >> >
    >> > If so CXX/Extensions.hxx and CXX/Objects.hxx will be in your
    >> '.' (ie > current dir) include path. Perhaps there is a
    >> problem with include > flags in setupext.py. Try replacing the
    >> add_base_flags function in > that file with this one:
    >> >
    >> > def add_base_flags(module): > incdirs = [os.path.join(p,
    >> 'include') for p in basedir[sys.platform] > if
    >> os.path.exists(p)] > libdirs = [os.path.join(p, 'lib') for p in
    >> basedir[sys.platform] > if os.path.exists(p)] >
    >> module.include_dirs.extend(incdirs) >
    >> module.include_dirs.append('.') >
    >> module.library_dirs.extend(libdirs)
    >> >
    >> >
    >> >
    >> > > I installed (through apt) python-cxx, but this
    >> didn't > Christopher> seem to change anything.
    >> >
    >> > No, we use our own CXX
    >> >
    >> > > This seems like a completely trivial problem >
    >> > (especially compared to the other frutrations I
    >> have > Christopher> had with matplotlib in the past), but I
    >> don't know > Christopher> how to fix it...
    >> >
    >> > Perhaps the approach above will fix it. If not, you may want
    >> to > enable universe and multiverse in your
    >> /etc/apt/sources.list and then > add
    >> >
    >> > deb http://peds-pc311.bsd.uchicago.edu binary/
    >> >
    >> > and do
    >> >
    >> > > sudo apt-get update > > sudo apt-get python-matplotlib-jdh
    >> >
    >> > These are hoary debs that I maintain for our local system.
    >> I'm > certainly an amateur debian package maker, but they seem
    >> to work and > usually track matplotlib CVS fairly closely.
    >> >
    >> > JDH
    >> >
    >> >
    >>