[matplotlib-devel] Error building from source - Ubuntu

Do not reply to me only, but always leave the list in CC.

···

On Mon, May 18, 2009 at 18:41, M Uhlenhuth <uhlenhuthm@...32...> wrote:

Thanks for your response!

Yes, have installed:
python2.5: version 2.5.4-1ubuntu4
python-dev: version 2.6.2-0ubuntu1
python-numpy: version 1:1.2.1-1ubuntu1
libpng12-0: version 1.2.27-2ubuntu2
libfreetype6: version 2.3.9-4ubuntu-0.1
libfreetype6-dev: version 2.3.9-4ubuntu-0.1

Is the issue that I'm using python-dev version 2.6 for python version 2.5?
If so... I can't figure out how to add python-dev version 2.5... in Synaptic
Package Manager the only available python-dev package is 2.6 - I can't
"Force Version" to get 2.5 and I'm not sure whether I would mess anything up
elsewhere on my system by substituting 2.5 for 2.6.

Sorry, I'm not a ubuntu user, so I can't exactly tell how to do it. Of
course the devel package version mismatch the interpreter one, and
that's a problem for sure.

if you don't have a python2.5-dev or a python-all-dev IO think you
can't find an easy solution; since numpy does not yet support py2.6,
building mpl with 2.6 is still not a solution.

--
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi

I discovered I actually did have python2.5-dev (just not a python-dev version 2.5!).

I compiled and ran the code, but I’m getting errors like:

In [2]: import matplotlib.pyplot as plt

···

ImportError Traceback (most recent call last)

/home/maximus/ in ()

/usr/lib/python2.5/site-packages/matplotlib/pyplot.py in ()
2
3 import matplotlib
----> 4 from matplotlib import _pylab_helpers, interactive
5 from matplotlib.cbook import dedent, silent_list, is_string_like, is_numlike
6 from matplotlib.figure import Figure, figaspect

ImportError: cannot import name interactive

I get errors like this too:

from pylab import *
Traceback (most recent call last):
File “”, line 1, in
File “/usr/lib/python2.5/site-packages/matplotlib/pylab.py”, line 201, in
from cbook import flatten, is_string_like, exception_to_str, popd,
File “/usr/lib/python2.5/site-packages/matplotlib/cbook.py”, line 6, in
import re, os, errno, sys, StringIO, traceback, locale, threading, types
File “/usr/lib/python2.5/threading.py”, line 13, in
from collections import deque
File “/usr/lib/python2.5/site-packages/matplotlib/collections.py”, line 15, in
import matplotlib.cbook as cbook
File “/usr/lib/python2.5/site-packages/matplotlib/cbook.py”, line 158, in
class Scheduler(threading.Thread):
AttributeError: ‘module’ object has no attribute ‘Thread’

When I built, I got a bunch of warnings:

maximus@…2609…:/usr/lib/python2.5/site-packages/matplotlib$ sudo python setup.py build > ~/matplotliberr.txt
cc1plus: warning: command line option “-Wstrict-prototypes” is valid for Ada/C/ObjC but not for C++
In file included from /usr/include/c++/4.3/ext/hash_map:64,
from ./CXX/Extensions.hxx:68,
from src/ft2font.h:4,
from src/ft2font.cpp:1:
/usr/include/c++/4.3/backward/backward_warning.h:33:2: warning: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated.
cc1plus: warning: command line option “-Wstrict-prototypes” is valid for Ada/C/ObjC but not for C++
cc1plus: warning: command line option “-Wstrict-prototypes” is valid for Ada/C/ObjC but not for C++
cc1plus: warning: command line option “-Wstrict-prototypes” is valid for Ada/C/ObjC but not for C++
In file included from /usr/include/c++/4.3/ext/hash_map:64,
from ./CXX/Extensions.hxx:68,
from CXX/cxx_extensions.cxx:37:
/usr/include/c++/4.3/backward/backward_warning.h:33:2: warning: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated.
cc1plus: warning: command line option “-Wstrict-prototypes” is valid for Ada/C/ObjC but not for C++
cc1plus: warning: command line option “-Wstrict-prototypes” is valid for Ada/C/ObjC but not for C++
cc1plus: warning: command line option “-Wstrict-prototypes” is valid for Ada/C/ObjC but not for C++
cc1plus: warning: command line option “-Wstrict-prototypes” is valid for Ada/C/ObjC but not for C++
cc1plus: warning: command line option “-Wstrict-prototypes” is valid for Ada/C/ObjC but not for C++
cc1plus: warning: command line option “-Wstrict-prototypes” is valid for Ada/C/ObjC but not for C++
cc1plus: warning: command line option “-Wstrict-prototypes” is valid for Ada/C/ObjC but not for C++
lib/matplotlib/delaunay/VoronoiDiagramGenerator.cpp: In member function ‘bool VoronoiDiagramGenerator::voronoi(int)’:
lib/matplotlib/delaunay/VoronoiDiagramGenerator.cpp:923: warning: ‘newintstar.Point::y’ may be used uninitialized in this function
cc1plus: warning: command line option “-Wstrict-prototypes” is valid for Ada/C/ObjC but not for C++
cc1plus: warning: command line option “-Wstrict-prototypes” is valid for Ada/C/ObjC but not for C++
cc1plus: warning: command line option “-Wstrict-prototypes” is valid for Ada/C/ObjC but not for C++
cc1plus: warning: command line option “-Wstrict-prototypes” is valid for Ada/C/ObjC but not for C++
cc1plus: warning: command line option “-Wstrict-prototypes” is valid for Ada/C/ObjC but not for C++
cc1plus: warning: command line option “-Wstrict-prototypes” is valid for Ada/C/ObjC but not for C++
cc1plus: warning: command line option “-Wstrict-prototypes” is valid for Ada/C/ObjC but not for C++
cc1plus: warning: command line option “-Wstrict-prototypes” is valid for Ada/C/ObjC but not for C++
cc1plus: warning: command line option “-Wstrict-prototypes” is valid for Ada/C/ObjC but not for C++
In file included from /usr/include/c++/4.3/ext/hash_map:64,
from ./CXX/Extensions.hxx:68,
from src/path.cpp:8:
/usr/include/c++/4.3/backward/backward_warning.h:33:2: warning: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated.
src/path.cpp: In function ‘void clip_to_rect(PathIterator&, double, double, double, double, bool, std::vector<std::vector<XY, std::allocator >, std::allocator<std::vector<XY, std::allocator > > >&)’:
src/path.cpp:824: warning: ‘y’ may be used uninitialized in this function
src/path.cpp:824: warning: ‘x’ may be used uninitialized in this function
agg24/include/agg_conv_curve.h: In member function ‘unsigned int agg::conv_curve<VertexSource, Curve3, Curve4>::vertex(double*, double*) [with VertexSource = PathIterator, Curve3 = agg::curve3, Curve4 = agg::curve4]’:
agg24/include/agg_conv_curve.h:160: warning: ‘end_y’ may be used uninitialized in this function
agg24/include/agg_conv_curve.h:159: warning: ‘end_x’ may be used uninitialized in this function
agg24/include/agg_conv_curve.h:158: warning: ‘ct2_y’ may be used uninitialized in this function
agg24/include/agg_conv_curve.h:157: warning: ‘ct2_x’ may be used uninitialized in this function
cc1plus: warning: command line option “-Wstrict-prototypes” is valid for Ada/C/ObjC but not for C++
cc1plus: warning: command line option “-Wstrict-prototypes” is valid for Ada/C/ObjC but not for C++
cc1plus: warning: command line option “-Wstrict-prototypes” is valid for Ada/C/ObjC but not for C++
In file included from /usr/include/c++/4.3/ext/hash_map:64,
from ./CXX/Extensions.hxx:68,
from src/ft2font.h:4,
from src/backend_agg.cpp:10:
/usr/include/c++/4.3/backward/backward_warning.h:33:2: warning: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated.
In file included from src/backend_agg.cpp:37:
src/swig_runtime.h: In function ‘void SWIG_Python_AddErrorMsg(const char*)’:
src/swig_runtime.h:859: warning: format not a string literal and no format arguments
cc1plus: warning: command line option “-Wstrict-prototypes” is valid for Ada/C/ObjC but not for C++
In file included from /usr/include/c++/4.3/ext/hash_map:64,
from ./CXX/Extensions.hxx:68,
from src/_image.h:13,
from src/image.cpp:33:
/usr/include/c++/4.3/backward/backward_warning.h:33:2: warning: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated.
cc1plus: warning: command line option “-Wstrict-prototypes” is valid for Ada/C/ObjC but not for C++
In file included from /usr/include/c++/4.3/ext/hash_map:64,
from ./CXX/Extensions.hxx:68,
from src/_png.cpp:9:
/usr/include/c++/4.3/backward/backward_warning.h:33:2: warning: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated.
src/_png.cpp: In member function ‘Py::Object _png_module::read_png(const Py::Tuple&)’:
src/_png.cpp:275: warning: comparison between signed and unsigned integer expressions
src/_png.cpp:279: warning: comparison between signed and unsigned integer expressions

Thanks!

-Max

Normally when you compile and install from src, the default location is /usr/local rather than /usr. Did you override this with --prefix or --install-lib? If not, I wonder if you are not using the version you think you are. Also, check the FAQ

http://matplotlib.sourceforge.net/faq/installing_faq.html

For suggestions on how to get a clean build and install.

JDH

···

On May 18, 2009 3:09pm, M Uhlenhuth <uhlenhuthm@…32…> wrote:

I discovered I actually did have python2.5-dev (just not a python-dev version 2.5!).

I compiled and ran the code, but I’m getting errors like:

In [2]: import matplotlib.pyplot as plt

ImportError Traceback (most recent call last)

/home/maximus/ in ()

/usr/lib/python2.5/site-packages/matplotlib/pyplot.py in ()
2

Yeah… I’m not sure either. Eventually I just through in the towel, deleted everything and sudo apt-get install python-matplotlb

Thanks for the help though!

-Max

···

Date: Mon, 18 May 2009 20:29:33 +0000
Subject: Re: Re: [Matplotlib-users] [matplotlib-devel] Error building from source - Ubuntu
From: jdh2358@…287…
To: uhlenhuthm@…32…
CC: morph@…10…; matplotlib-users@…2018…rceforge.net

On May 18, 2009 3:09pm, M Uhlenhuth <uhlenhuthm@…713…2…> wrote:

I discovered I actually did have python2.5-dev (just not a python-dev version 2.5!).

I compiled and ran the code, but I’m getting errors like:

In [2]: import matplotlib.pyplot as plt

ImportError Traceback (most recent call last)

/home/maximus/ in ()

/usr/lib/python2.5/site-packages/matplotlib/pyplot.py in ()
2

Normally when you compile and install from src, the default location is /usr/local rather than /usr. Did you override this with --prefix or --install-lib? If not, I wonder if you are not using the version you think you are. Also, check the FAQ

http://matplotlib.sourceforge.net/faq/installing_faq.html

For suggestions on how to get a clean build and install.

JDH