Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_scproxy import error when building on Mac with 'requests' lib #186

Closed
dustinfarris opened this issue Dec 18, 2013 · 3 comments
Closed

_scproxy import error when building on Mac with 'requests' lib #186

dustinfarris opened this issue Dec 18, 2013 · 3 comments

Comments

@dustinfarris
Copy link

Building on a Mac while requiring the 'requests' Python library causes an import error on Android.

Excerpt from logcat:

I/python  ( 5771):  Traceback (most recent call last):
I/python  ( 5771):    File "/Users/dustin/Code/edtitan-client/.buildozer/android/app/main.py", line 7, in <module>
I/python  ( 5771):    File "/Users/dustin/Code/edtitan-client/.buildozer/android/app/edtitan/connection.py", line 1, in <module>
I/python  ( 5771):    File "/Users/dustin/Code/edtitan-client/.buildozer/android/app/_applibs/requests/__init__.py", line 58, in <module>
I/python  ( 5771):    File "/Users/dustin/Code/edtitan-client/.buildozer/android/app/_applibs/requests/utils.py", line 12, in <module>
I/python  ( 5771):    File "/Users/dustin/Code/edtitan-client/.buildozer/android/platform/python-for-android/dist/default/private/lib/python2.7/cgi.py", line 40, in <module>
I/python  ( 5771):    File "/Users/dustin/Code/edtitan-client/.buildozer/android/platform/python-for-android/dist/default/private/lib/python2.7/urllib.py", line 1360, in <module>
I/python  ( 5771):  ImportError: No module named _scproxy
I/python  ( 5771): Python for android ended.

This is seems to be related to the fact that _scproxy is a Mac-specific Python library. The error can be worked around by adding the following to the top of main.py:

import sys
sys.platform = 'linux2'

/cc @akshayaurora

@yagupta
Copy link

yagupta commented Apr 23, 2014

The above does not seem to solve my issues, I have the exact same problem but when I change main.py I don't see any changes (I am on a Mac/OSX)

I/python (21089): File "/Users/yatharth/src/ktest2/.buildozer/android/app/main.py", line 3, in
I/python (21089): File "/Users/yatharth/src/ktest2/.buildozer/android/app/_applibs/soco/init.py", line 12, in
I/python (21089): File "/Users/yatharth/src/ktest2/.buildozer/android/app/_applibs/soco/core.py", line 5, in
I/python (21089): File "/Users/yatharth/src/ktest2/.buildozer/android/app/_applibs/requests/init.py", line 58, in
I/python (21089): File "/Users/yatharth/src/ktest2/.buildozer/android/app/_applibs/requests/utils.py", line 12, in
I/python (21089): File "/Users/yatharth/src/ktest2/.buildozer/android/platform/python-for-android/dist/myapp/private/lib/python2.7/cgi.py", line 40, in
I/python (21089): File "/Users/yatharth/src/ktest2/.buildozer/android/platform/python-for-android/dist/myapp/private/lib/python2.7/urllib.py", line 1360, in
I/python (21089): ImportError: No module named _scproxy
I/python (21089): Python for android ended.

@dustinfarris
Copy link
Author

@y99 it looks like line 3 of your main.py is triggering the issue. Did you place the workaround code above this line?

@yagupta
Copy link

yagupta commented Apr 23, 2014

No i did not, after doing so - the problem seems to have gone away ! - thanks

alanjds added a commit to alanjds/python-for-android that referenced this issue Dec 11, 2014
tito added a commit that referenced this issue Dec 30, 2014
@tito tito closed this as completed Dec 30, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants