5

カスタムビルドのpython 3.1で使用するためにpycairo 1.10.0をインストールしようとしています。でも、

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述べています。

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/

または類似; ただし、これにより次のエラーが発生します。

  ./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バージョンが単にそれ自体で実行されるものであることをこのことを伝える方法はないように見えるので、私は手探りしてこれまでに取得しました:

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 コードは、かなり扱いにくいものです。

どのように進むべきか提案はありますか?*.debpycairo + python 3の準備ができていますか?何も見つかりませんでした。

4

3 に答える 3

10

そのサブディレクトリにあるpython.pyファイルを見て、wafからpython3を実行する前に環境変数を設定してみることにしました。exportPYTHON
= "python3"
そして、インストールは不思議なことに成功しました...

于 2011-07-17T09:15:10.683 に答える
4

I'm using Ubuntu Karmic, but installing with python2.7 compiled from source, so this is a work around I found in my case. I though it might be helpful, but please use caution.

I found some discussion threads that has similar installation problems here

Although it's not the same python version, there are some flags which you can set for waf.

I got past that Python.h part after using the following command

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

As I have compiled from source python2.7, I need to reroute the paths with CFLAGS. The final command looks like this:

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

I have no idea how the LDFLAGS work, so use with caution.

Alternatively (dangerous method), if you don't want to set the CFLAGS, I did do some symbolic-re-linking in the /local/bin of python to my python2.7, same with python-config to python2.7-config (if you installed from package manager, you might not need to do this)

于 2011-07-25T04:51:12.027 に答える
2

これは明らかに pycairo インストーラーのバグであり、Python exe がどこにあるかを見つけようとします (実行する Python exe を単純に使用する必要がある場合)。

私はそれを見つけようとしましたが、このコードは独自の完全にカスタムのビルドシステムを使用しており (理由は明らかではありません)、コードは非常に奇妙な方法でレイアウトされており、驚くべきことに、コードの主要部分が(!)という名前のディレクトリに隠され.waf3-1.6.4-e3c1e08604b18a10567cfcd2d02eb6e6ています。そして、私が今まで見た中で最も読みにくい Python コードで書かれています。そのため、このコードを理解し、おそらく些細なバグを解決するのに何時間もかかるでしょう。

このライブラリが本当に必要な場合は、作者に連絡して、バグを修正できるかどうかよく尋ねることをお勧めします。

于 2011-06-04T09:37:32.553 に答える