uboot编译 sh: 1: python: not found ,cripts/dtc/pylibfdt/_libfdt.so' failed解决

如果排查的思路对你有帮助,请记住 消雨匆匆 or  大吊工。 码字和排查很累,仅此而已

编译Uboot出现以下错误,

/bin/sh: 1: python: not found
scripts/dtc/pylibfdt/Makefile:26: recipe for target 'scripts/dtc/pylibfdt/_libfdt.so' failed
make[3]: *** [scripts/dtc/pylibfdt/_libfdt.so] Error 127
scripts/Makefile.build:425: recipe for target 'scripts/dtc/pylibfdt' failed
make[2]: *** [scripts/dtc/pylibfdt] Error 2
scripts/Makefile.build:425: recipe for target 'scripts/dtc' failed
make[1]: *** [scripts/dtc] Error 2
Makefile:491: recipe for target 'scripts' failed
make: *** [scripts] Error 2
 

前面已经安装了

 apt-get install swig python-dev python3-dev

但是看错误好像是python的一些依赖库没有找到,找了一圈度娘没有人回答。

这是因为软连接的原因,可以查看一下:

 ls -l /usr/bin/python*
发现系统给我的python软连接到python3.6,而我这边只有3.5和2.7:

lrwxrwxrwx 1 root root      18 9月  21  2018 /usr/bin/python -> /usr/bin/python3.6
lrwxrwxrwx 1 root root       9 11月 24  2017 /usr/bin/python2 -> python2.7
-rwxr-xr-x 1 root root 3492656 11月 13 03:46 /usr/bin/python2.7
lrwxrwxrwx 1 root root      33 11月 13 03:46 /usr/bin/python2.7-config -> x86_64-linux-gnu-python2.7-config
lrwxrwxrwx 1 root root      16 11月 24  2017 /usr/bin/python2-config -> python2.7-config
lrwxrwxrwx 1 root root       9 9月  21  2018 /usr/bin/python3 -> python3.5
-rwxr-xr-x 2 root root 4464368 11月 13 00:27 /usr/bin/python3.5
lrwxrwxrwx 1 root root      33 11月 13 00:27 /usr/bin/python3.5-config -> x86_64-linux-gnu-python3.5-config
-rwxr-xr-x 2 root root 4464368 11月 13 00:27 /usr/bin/python3.5m
lrwxrwxrwx 1 root root      34 11月 13 00:27 /usr/bin/python3.5m-config -> x86_64-linux-gnu-python3.5m-config
lrwxrwxrwx 1 root root      16 3月  23  2016 /usr/bin/python3-config -> python3.5-config
lrwxrwxrwx 1 root root      10 9月  21  2018 /usr/bin/python3m -> python3.5m
lrwxrwxrwx 1 root root      17 3月  23  2016 /usr/bin/python3m-config -> python3.5m-config
lrwxrwxrwx 1 root root      16 11月 24  2017 /usr/bin/python-config -> python2.7-config
于是重新修改

sudo ln -s /usr/bin/python2.7 /usr/bin/python
 

再make一下,就可以了

uboot编译 sh: 1: python: not found ,cripts/dtc/pylibfdt/_libfdt.so' failed解决_第1张图片

 

你可能感兴趣的:(linux)