Android运行Python

下载

libpython3.8-minimal_3.8.6-1_arm64.deb (https://mirrors.tuna.tsinghua.edu.cn/debian/pool/main/p/python3.8/libpython3.8-minimal_3.8.6-1_arm64.deb)

libpython3.8-stdlib_3.8.6-1_arm64.deb (https://mirrors.tuna.tsinghua.edu.cn/debian/pool/main/p/python3.8/libpython3.8-stdlib_3.8.6-1_arm64.deb)

python3.8-minimal_3.8.6-1_arm64.deb (https://mirrors.tuna.tsinghua.edu.cn/debian/pool/main/p/python3.8/python3.8-minimal_3.8.6-1_arm64.deb)

libexpat1_2.2.0-2+deb9u3_arm64.deb (https://mirrors.tuna.tsinghua.edu.cn/debian/pool/main/e/expat/libexpat1_2.2.0-2+deb9u3_i386.deb)

zlib1g_1.2.11.dfsg-2_arm64.deb (https://mirrors.tuna.tsinghua.edu.cn/debian/pool/main/z/zlib/zlib1g_1.2.11.dfsg-2_arm64.deb)

安装gcc-10-aarch64-linux-gnu,除了libexpat.so.1和libz.so.1剩下的动态链接库都在/usr/aarch64-linux-gnu/lib。顺便说一下可以用apt-file search搜索文件所在的package。

libpthread.so.0
libdl.so.2
libutil.so.1
libm.so.6
libexpat.so.1
libz.so.1
libc.so.6
ld-linux-aarch64.so.1

然后用patchelf修改interpreter和rpath(参考Android运行Linux程序)。因为python安装的位置不是/usr/bin所以要设置PYTHONPATH,然后就可以在Android上使用python了。

上一篇:Visual Studio Code新增ARM支持


下一篇:ARM64架构下安装Python package