【问题标题】:Crosstool-ng python errorCrosstool-ng python 错误
【发布时间】:2013-06-07 00:50:51
【问题描述】:

我最近尝试为我的手臂板编译 crosstool-ng。 主机是 Arch linux 3.9.4-1。 我遇到了以下问题:

[ALL  ]    checking for python... /usr/bin/python
[ALL  ]      File "/home/godard_b/workspace/raspberry_pi/staging/.build/src/gdb-7.4.1/gdb/python/python-config.py", line 47
[ALL  ]        print to_unix_path(sysconfig.PREFIX)
[ALL  ]                         ^
[ALL  ]    SyntaxError: invalid syntax
[ERROR]    configure: error: failure running python-config --includes
[ERROR]    make[2]: *** [configure-gdb] Error 1
[ALL  ]    make[2]: Leaving directory `/home/godard_b/workspace/raspberry_pi/staging/.build/arm-unknown-linux-gnueabi/build/build-gdb-cross'
[ERROR]    make[1]: *** [all] Error 2
[ALL  ]    make[1]: Leaving directory `/home/godard_b/workspace/raspberry_pi/staging/.build/arm-unknown-linux-gnueabi/build/build-gdb-cross'
[ERROR]  
[ERROR]  >>
[ERROR]  >>  Build failed in step 'Installing cross-gdb'
[ERROR]  >>        called in step '(top-level)'
[ERROR]  >>
[ERROR]  >>  Error happened in: CT_DoExecLog[scripts/functions@258]
[ERROR]  >>        called from: do_debug_gdb_build[scripts/build/debug/300-gdb.sh@177]
[ERROR]  >>        called from: do_debug[scripts/build/debug.sh@35]
[ERROR]  >>        called from: main[scripts/crosstool-NG.sh@609]
[ERROR]  >>
[ERROR]  >>  For more info on this error, look at the file: 'build.log'
[ERROR]  >>  There is a list of known issues, some with workarounds, in:
[ERROR]  >>      '/usr/share/doc/crosstool-ng/ct-ng.1.17.0/B - Known issues.txt'
[ERROR]  
[ERROR]  (elapsed: 132:05.60)

当我跑步时:

python-config --include

它工作正常,所以我想知道问题可能出在哪里。 感谢您的帮助。

【问题讨论】:

    标签: linux bash compiler-errors cross-compiling crosstool-ng


    【解决方案1】:

    我遇到了同样的问题,问题就在这里:

    [ALL  ]        print to_unix_path(sysconfig.PREFIX)
    [ALL  ]                         ^
    [ALL  ]    SyntaxError: invalid syntax
    

    这意味着它使用的是Python 3而不是Python 2,可能是因为python指向python3(这是Arch中的默认值)k

    要解决这个问题,只需创建一个新目录(我在 home 上创建了一个名为 bin 的目录)并创建两个名为 python 和 python-config 的符号链接指向 python2 和 python2-config:

    mkdir ~/bin
    ln -s /bin/python2 ~/bin/python
    ln -s /bin/python2-config ~/bin/python-config
    

    现在再次尝试构建 crosstool-ng,在 PATH 开头的 python2 处添加带有 python 链接的目录:

    PATH=$HOME/bin:$PATH crosstool-ng build
    

    来源: https://wiki.archlinux.org/index.php/Python

    【讨论】:

      猜你喜欢
      • 2020-08-18
      • 1970-01-01
      • 2019-12-24
      • 1970-01-01
      • 2012-12-02
      • 2015-05-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多