1

I have installed qpython for android, the problem is that when I install a module with pip in the python console I can import it properly, but not when I try to import it to a script.

in console ... I type:

>>>import requests
>>>requests
<module 'requests' from '/data/data/com.hipipal.qpyplus/.../__init__.py>

but in a script saved in scripts' folder, when I execute:

import requests
r = requests.get("http://www.google.com")
print r.text.encode('utf-8')

I get this:

import requests
ImportError: no module named requests

Can anybody help with that?

Thank you!

4

1 回答 1

1

添加导入站点。

这适用于我的平板电脑:

#-*-coding:utf8;-*-
#qpy:2
#qpy:console
import site
import requests
r = requests.get("http://www.google.com")
print r.text.encode('utf-8')
于 2015-08-26T20:43:11.357 回答