How to install pycairo for python 3 on Ubuntu 10.04

I am trying to install pycairo 1.10.0 for use with my python 3.1. However,

sudo /flower/bin/easy_install-3.1 pycairo

not working with

XXX@XXXX:/adventures$ sudo /flower/bin/easy_install-3.1 pycairo
install_dir /flower/lib/python3.1/site-packages/
Searching for pycairo
Reading http://pypi.python.org/simple/pycairo/
Reading http://cairographics.org/pycairo
Best match: pycairo 1.10.0
Downloading http://cairographics.org/releases/pycairo-1.10.0.tar.bz2
Processing pycairo-1.10.0.tar.bz2
error: Couldn't find a setup script in /tmp/easy_install-zeG9HB/pycairo-1.10.0.tar.bz2

and, indeed, there isn’t in the download mentioned setup.py; instead INSTALLsays:

Install Procedure
-----------------
$ ./waf --help     # shows available waf options
$ ./waf configure  # use --prefix and --libdir if necessary
                   # --prefix=/usr --libdir=/usr/lib64  for Fedora 64-bit
$ ./waf build
$ ./waf install

Use
$ python3 ./waf ...
if you have python2 and python3 installed, and the default is python 2.


Testing
-------
See test/README

I understand that by telling me that I should

sudo /flower/bin/python3.1 ./waf configure --prefix=/flower/pycairo/

or similar; however, this results in the following error:

  ./options()
Setting top to                           : /tmp/pycairo-1.10.0 
Setting out to                           : /tmp/pycairo-1.10.0/build_directory 
  ./configure()
Checking for 'gcc' (c compiler)          : ok 
Checking for program python              : /usr/bin/python 
python executable '/usr/bin/python' different from sys.executable '/flower/bin/python3.1'
Checking for python version              : (2, 6, 5, 'final', 0) 
The python version is too old, expecting (3, 1, 0)

so I went down to the source code; there seems to be no way to tell this wafthingie that the target version of python is just the one it works on its own, so I rummaged around and got to this:

Checking for 'gcc' (c compiler)          : ok 
Checking for program python              : /usr/bin/python 
#############293 /flower/bin/python3.1
Checking for python version              : (3, 1, 2, 'final', 0) 
Checking for library python3.1 in LIBDIR : yes 
Checking for program python3.1-config    : not found 
Checking for program python-config-3.1   : not found 
Checking for header Python.h             : Could not find the python development headers 
Checking for []                          : not found 
The configuration failed

I really have a file /flower/bin/python3.1-config, so I don’t understand it. the python code that does all this is pretty hard to handle.

- , ? *.deb pycairo + python 3? .

+5
3

python.py , var waf python3:
export PYTHON = "python3"
...

+10

Ubuntu Karmic, python2.7, , , . , , , .

,

python, , waf.

Python.h

LDFLAGS="-lm -ldl -lutil" ./waf configure

python2.7, CFLAGS. :

CFLAGS="-l/usr/local/include/python2.7 -l/usr/local/bin" LDFLAGS="-lm -ldl -lutil" ./waf configure

, LDFLAGS, .

( ), CFLAGS, /local/bin python python2.7, python-config python2. 7-config ( , )

+4

pycairo, , exe Python ( Python exe, ).

, ( ) , hidden (!) .waf3-1.6.4-e3c1e08604b18a10567cfcd2d02eb6e6 Python, - . , , , , , .

, , .

+2

All Articles