我如何在 qpython3(python 的 Android 端口)上安装模块
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/38598880/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How do I install modules on qpython3 (Android port of python)
提问by Enclo Creations
I found this great module on within and downloaded it as a zip file. Once I extracted the zip file, i put the two modules inside the file(setup and the main one) on the module folder including an extra read me file I needed to run. I tried installing the setup file but I couldn't install it because the console couldn't find it. So I did some research and I tried using pip to install it as well, but that didn't work. So I was wondering if any of you could give me the steps to install it manually and with pip (keep in mind that the setup.py file needs to be installed in order for the main module to work).
我在里面找到了这个很棒的模块并将其下载为 zip 文件。解压缩 zip 文件后,我将两个模块放在模块文件夹中的文件(设置和主模块)中,其中包括我需要运行的额外自述文件。我尝试安装安装文件,但无法安装,因为控制台找不到它。所以我做了一些研究,我也尝试使用 pip 来安装它,但这没有用。所以我想知道你们中是否有人可以给我手动和使用 pip 安装它的步骤(请记住,需要安装 setup.py 文件才能使主模块工作)。
Thanks!
谢谢!
回答by sillyMunky
The cleanest and simplest way I have found is to use pip from within QPython console as in This Answer
我发现的最干净和最简单的方法是在 QPython 控制台中使用 pip,如This Answer 中所示
import pip
pip.main(['install', 'networkx'])
回答by Mohan B E
Extract the zip file to the site-packages folder. Find the qpyplus folder in that Lib/python3.2/site-packages extract here that's it.Now you can directly use your module from REPL terminal by importing it.
将 zip 文件解压缩到 site-packages 文件夹。在 Lib/python3.2/site-packages 解压中找到 qpyplus 文件夹就是这样。现在您可以通过导入直接从 REPL 终端使用您的模块。