如何在Ubuntu 10.04上为python 3安装pycairo [英] how to install pycairo for python 3 on Ubuntu 10.04
问题描述
我正在尝试安装pycairo 1.10.0以与我的自定义构建python 3.1一起使用.但是,
i am trying to install pycairo 1.10.0 for use with my custom-build python 3.1. however,
sudo /flower/bin/easy_install-3.1 pycairo
失败
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
,实际上,该下载文件中没有setup.py
;相反,INSTALL
表示:
and indeed, there is no setup.py
in the said download; instead, the INSTALL
says:
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
我知道我告诉我应该
sudo /flower/bin/python3.1 ./waf configure --prefix=/flower/pycairo/
或类似;但是,这会导致以下错误:
or similar; however, this leads to 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)
所以我进入了源代码;似乎没有办法告诉waf
事情,目标python版本就是它自己运行的版本,所以我摸索着走到最远:
so i went down into the source code; there is seemingly no way to tell this waf
thingie that the targetted python version is simply the one it runs on itself, so i fumbled around and got as far as 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
我实际上有一个文件/flower/bin/python3.1-config
,所以我不知道.完成所有这些操作的python代码很难处理.
i do in fact have a file /flower/bin/python3.1-config
so i don't get it. the python code that does all this is rather hard to handle.
任何建议如何进行? pycairo + python 3是否已准备好*.deb
或类似版本?找不到任何东西.
any suggestions how to go on? is there a *.deb
or similar ready for pycairo + python 3? couldn't find any.
推荐答案
通过查看该子目录中的python.py文件,我决定在通过python3执行waf之前尝试设置环境var:
导出PYTHON ="python3"
然后安装神秘地成功了……
By looking at the python.py file in that subdir I decided to try setting an environment var before executing the waf thru python3:
export PYTHON="python3"
And then the install mysteriously succeeded...
这篇关于如何在Ubuntu 10.04上为python 3安装pycairo的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!