在android上安装python包
我想在 android 上从源代码安装 python 包。这可能吗?我尝试在控制台中运行 py 安装文件,但未找到 distutils (.core, ccompiler)。还可以安装它们吗?
I want to install a python package from source on android. Is this possible? I tried in the console to run the py install files, but distutils (.core, ccompiler) isn't being found. Is it possible to still install them?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Android 不附带 Python 解释器,也不附带
gcc
或其他编译器。您需要从某处获取 ARM 二进制文件或自己交叉编译一个。 (顺便说一句,我假设是 ARM,但可以替换为您碰巧运行的任何架构)。Android does not ship with a Python interpreter, nor does it ship with
gcc
or other compilers. You will need to get an ARM binary from somewhere or cross-compile one yourself. (BTW, I'm assuming ARM, but substitute in whatever architecture you happen to be running).如果您使用 ASE(Android 脚本环境),并且要安装的包是纯 python(即没有 C 编译库),您只需将包的目录手动复制到 sdcard 上,即 /sdcard/ase /extras/python(如 ASE 常见问题解答中指定)。
If you're using ASE (Android Scripting Environment), and the package you want to install is pure-python (that is, no C compiled libraries), you can simply copy the package's directory manually onto the sdcard, to /sdcard/ase/extras/python (as specified on the ASE FAQ).