Open GoogleCodeExporter opened 9 years ago
I run the source ~python-lib_r16/python.sh and tried to build the module again:
victor@victor-desktop:~/Desktop/python/requests$ python2.6 setup.py bdist_egg
'import site' failed; use -v for traceback
Traceback (most recent call last):
File "setup.py", line 10, in <module>
import requests
File "/home/victor/Desktop/python/requests/requests/__init__.py", line 25, in <module>
from . import utils
File "/home/victor/Desktop/python/requests/requests/utils.py", line 19, in <module>
from .compat import parse_http_list as _parse_list_header
File "/home/victor/Desktop/python/requests/requests/compat.py", line 85, in <module>
import cookielib
File "/home/manuel/AptanaStudio3Workspace/python-for-android/python-build/output/usr/lib/python2.6/cookielib.py", line 38, in <module>
File "/home/manuel/AptanaStudio3Workspace/python-for-android/python-build/output/usr/lib/python2.6/calendar.py", line 9, in <module>
ImportError:
/home/victor/Desktop/python/com.googlecode.pythonforandroid/files/python/lib/pyt
hon2.6/lib-dynload/datetime.so: wrong ELF class: ELFCLASS32
Original comment by victorja...@gmail.com
on 29 May 2012 at 4:54
Where is the python binary referenced inside the python.sh file ?
/data/data/com.googlecode.pythonforandroid/files/python/bin/python "$@"
The binary doesn't exists
Original comment by victorja...@gmail.com
on 29 May 2012 at 4:55
Another error calling binary python:
victor@victor-desktop:~/Desktop/python/requests$ python
ImportError: Bad magic number in
/home/victor/Desktop/python/com.googlecode.pythonforandroid/extras/python/site.p
yc
Original comment by victorja...@gmail.com
on 29 May 2012 at 4:57
requests is pure python. I was able to install it by just copying the extracted
folder to the site-packages folder in
/mnt/sdcard/com.googlecode.pythonforandroid/extras/python/ and then adding
site-packages to the pythonpath either using the standalone shell script or by
importing sys and running
sys.path.append('/mnt/sdcard/com.googlecode.pythonforandroid/extras/python/site-
packages'). This worked for every module I imported: requests, rpdb (remote
debugging) and dulwich (pure git wrapper).
Another option is to install distribute, which works well with the standalone
shell script, but may have issues in the sl4a interpreter.
http://poquitopicante.blogspot.com/2013/01/distributesetuptools-for-py4a.html
Original comment by bwanama...@gmail.com
on 8 Jan 2013 at 7:34
You need to install python-lib first and extract it then add module source code
on top of that. I have created a script you can use to generate modules from
git reops: https://cs.uwaterloo.ca/~hmohajer/module-creator.sh
Original comment by hooma...@gmail.com
on 1 Mar 2014 at 9:54
Original issue reported on code.google.com by
victorja...@gmail.com
on 29 May 2012 at 4:33