python3ubunton安装视频_如何在Ubuntu 10.04上为python 3安装pycairo

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

fails 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 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

i understand that as telling me that i should

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)

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

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.

any suggestions how to go on? is there a *.deb or similar ready for pycairo + python 3? couldn't find any.

解决方案

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...

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值