Python3版本移植到openwrt,运行失败解决方法

移植方法参考:

https://blog.****.net/Colin_xuan/article/details/81109328   直接复制到Ubuntu下,再修改会有问题, 我是手动写了一遍,

 

主要修改路径, 编译工具链  ../configure --host=arm-openwrt-linux --build=x86_64-linux-gnu --target=arm-openwrt-linux --disable-ipv6 --prefix=/home/marvin/tool/arm-python --enable-shared --silent

其他未修改, 

编译完成后生成的目录如下:ImportError: No module named '_sysconfigdata'

Python3版本移植到openwrt,运行失败解决方法

拷贝的时候bin下有链接符号拷贝不成功, 可以忽略不管。

文件拷贝到openwrt系统设置环境变量   export LD_LIBRARY_PATH   跟PATH即可

运行的时候会提示如下错误:

Python3版本移植到openwrt,运行失败解决方法

解决方法:在Ubuntu系统找到这个_sysconfigdata.py,拷贝到板子python的lib目录下

在运行会提示: ImportError: No module named '_sysconfigdata_nd'

按前面的解决方法,找到py文件拷贝到系统里面,即可运行python了。