簡體   English   中英

waf構建系統找不到python庫

[英]waf build system can not find python libraries

我正在嘗試為python3構建pycairo-1.0並獲得不良輸出

root@blackenedsun:/home/blackenedsun/Downloads/pycairo-1.10.0# ./waf configure --prefix=/usr 
  ./options()
Setting top to                           : /home/blackenedsun/Downloads/pycairo-1.10.0 
Setting out to                           : /home/blackenedsun/Downloads/pycairo-1.10.0/build_directory 
  ./configure()
Checking for 'gcc' (c compiler)          : ok 
Checking for program python              : /usr/local/bin/python
Checking for python version              : (3, 3, 2, 'final', 0)
Checking for library python3.3 in LIBDIR : not found 
Checking for library python3.3 in python_LIBPL : not found 
Checking for library python3.3 in $prefix/libs : not found 
Checking for library python3.3m in LIBDIR      : yes 
Checking for program python3.3-config          : /usr/bin/python3.3-config 
command ['/usr/local/bin/python', '/usr/bin/python3.3-config', '--includes'] returned 1
root@blackenedsun:/home/blackenedsun/Downloads/pycairo-1.10.0# 

我該怎么做才能正確找到python3.3庫?

我在python 3.4中遇到了同樣的問題。

這是因為waf試圖用python執行python3.4-config而python3.4-config是shell腳本。

事實上,單獨啟動python3.4-config非常有效。

[dusserm@l92-ci-e pycairo-1.10.0]$ python3 /Produits/publics/x86_64.Linux.RH6/python/3.4.1/bin/python3.4-config --includes
      File "/Produits/publics/x86_64.Linux.RH6/python/3.4.1/bin/python3.4-config", line 7
        echo "Usage: $0 --prefix|--exec-prefix|--includes|--libs|--cflags|--ldflags|--extension-suffix|--help|--abiflags|--configdir"
                                                                                                                                    ^
    SyntaxError: invalid syntax
    [dusserm@l92-ci-e pycairo-1.10.0]$ /Produits/publics/x86_64.Linux.RH6/python/3.4.1/bin/python3.4-config --includes
    -I/nfs/nfs/Produits/publics/x86_64.Linux.RH6/python/3.4.1/include/python3.4m -I/nfs/nfs/Produits/publics/x86_64.Linux.RH6/python/3.4.1/include/python3.4m

問題來自waf沒有正確使用python3.X-config。

我發現的解決方法是直接修改waf腳本解壓縮的隱藏目錄(在我的例子中是.waf3-1.6.4-e3c1e08604b18a10567cfcd2d02eb6e6)。 轉到這個目錄,更改文件waflib / Tools / python.py直接調用python3.X-config而不用python。

--- waflib/Tools/python.py.old  2014-08-01 14:36:23.750613874 +0000
+++ waflib/Tools/python.py      2014-08-01 14:36:38.359627761 +0000
@@ -169,7 +169,7 @@
                conf.find_program('python-config-%s'%num,var='PYTHON_CONFIG',mandatory=False)
        includes=[]
        if conf.env.PYTHON_CONFIG:
-               for incstr in conf.cmd_and_log(conf.env.PYTHON+[conf.env.PYTHON_CONFIG,'--includes']).strip().split():
+               for incstr in conf.cmd_and_log([conf.env.PYTHON_CONFIG,'--includes']).strip().split():
                        if(incstr.startswith('-I')or incstr.startswith('/I')):
                                incstr=incstr[2:]
                        if incstr not in includes:

我遇到了同樣的問題。 我修改了這樣的系統變量:
['/usr/local/bin/python3.4','/ usr / local / bin / python3.4-config',' - include']返回1

export PYTHON_CONFIG="/usr/local/lib/python3.4/config-3.4m/python-config.py"

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM