I installed the QPython on my (rooted) phone. I'm having trouble, however, running the python binary over the adb shell (busybox).
I can run the python binary after setting:
export LD_LIBRARY_PATH=/vendor/lib:/system/lib:/data/data/com.hipipal.qpyplus/files
However, I cannot import any module from the standard library even setting $PYTHONPATH
export PYTHONPATH=/data/data/com.hipipal.qpyplus/files/lib/python2.7/site-packages
I found a piece of advice how to run QPython in different terminal on the community wiki ( http://wiki.qpython.org/hacker/#how-to-execute-qpythons-python-in-other-terminals ), and I dumped the enviromnent and loaded it in the adb shell, the loaded python still could not load any libraries from standard library, like random.
Loading standard libraries from QPython console works just fine. Any pointers?
In my experience you only need to set two variables for this to work:
but you need to run as root so you can access things in
/data/data/org.qpython.qpy/
I got python to work by following the provided link, http://wiki.qpython.org/hacker/#how-to-execute-qpythons-python-in-other-terminals, prepending all lines in the script with
export
, then running as root ". /sdcard/qpyenv.sh
". Finally I could run "python
" and "import os
" and all warning at the top disappeared.