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

p4a gets stuck at downloading setuptools #2199

Closed
adriankokai opened this issue May 14, 2020 · 7 comments
Closed

p4a gets stuck at downloading setuptools #2199

adriankokai opened this issue May 14, 2020 · 7 comments

Comments

@adriankokai
Copy link

Versions

  • Python: 3.6
  • OS: ubuntu bash on windows
  • Kivy: 1.11.1
  • Cython:

Description

Im trying to compile a simple helloworld program but p4a is getting stuck at 'downloading setuptools' I tried using both setuptools and buildozer and Im getting stuck at the same point.

Command:
p4a apk --private /mnt/d/adrian/projects/helloworld/ --package=com.helloworld.app --name "helloworld" --version 0.1 --bootstrap=sdl2 --require
ments=python3,kivy,setuptools --sdk-dir /usr/lib/android-sdk/cmdline-tools/`

Logs

adrian@DESKTOP-SURCTH0:~$ p4a apk --private /mnt/d/adrian/projects/helloworld/ --package=com.helloworld.app --name "helloworld" --version 0.1 --bootstrap=sdl2 --require
ments=python3,kivy,setuptools --sdk-dir /usr/lib/android-sdk/cmdline-tools/
[WARNING]: $ANDROIDNDKVER is deprecated and no longer necessary, the value you set is ignored
[INFO]: Will compile for the following archs: armeabi-v7a
[INFO]: Found Android API target in $ANDROIDAPI: 27
[INFO]: Available Android APIs are (27)
[INFO]: Requested API target 27 is available, continuing.
[INFO]: Found NDK dir in $ANDROIDNDK: /usr/lib/android-ndk-r19c
[INFO]: Found NDK version 19c
[INFO]: Found Android API target in $NDKAPI
[INFO]: Found the following toolchain versions: ['4.9']
[INFO]: Picking the latest gcc toolchain, here 4.9
[INFO]: No existing dists meet the given requirements!
[INFO]: No dist exists that meets your requirements, so one will be built.
[INFO]: Found a single valid recipe set: ['hostpython3', 'libffi', 'openssl', 'sdl2_image', 'sdl2_mixer', 'sdl2_ttf', 'sqlite3', 'python3', 'sdl2', 'setuptools', 'six', 'pyjnius', 'android', 'kivy']
[INFO]: The selected bootstrap is sdl2
[INFO]: # Creating dist with sdl2 bootstrap
[INFO]: Dist will have name unnamed_dist_1 and requirements (python3, kivy, setuptools)
[INFO]: Dist contains the following requirements as recipes: ['hostpython3', 'libffi', 'openssl', 'sdl2_image', 'sdl2_mixer', 'sdl2_ttf', 'sqlite3', 'python3', 'sdl2', 'setuptools', 'six', 'pyjnius', 'android', 'kivy']
[INFO]: Dist will also contain modules (certifi) installed from pip
[INFO]: -> directory context /home/adrian/.local/share/python-for-android/build/bootstrap_builds/sdl2
[INFO]: <- directory context /home/adrian
[INFO]: Recipe build order is ['hostpython3', 'libffi', 'openssl', 'sdl2_image', 'sdl2_mixer', 'sdl2_ttf', 'sqlite3', 'python3', 'sdl2', 'setuptools', 'six', 'pyjnius', 'android', 'kivy']
[INFO]: The requirements (certifi) were not found as recipes, they will be installed with pip.
[INFO]: # Downloading recipes
[INFO]: Downloading hostpython3
[INFO]: -> running mkdir -p /home/adrian/.local/share/python-for-android/packages/hostpython3
[INFO]: -> directory context /home/adrian/.local/share/python-for-android/packages/hostpython3
[INFO]: -> running basename https://www.python.org/ftp/python/3.8.1/Python-3.8.1.tgz
[INFO]: hostpython3 download already cached, skipping
[INFO]: <- directory context /home/adrian
[INFO]: Downloading libffi
[INFO]: -> running mkdir -p /home/adrian/.local/share/python-for-android/packages/libffi
[INFO]: -> directory context /home/adrian/.local/share/python-for-android/packages/libffi
[INFO]: -> running basename https://github.com/libffi/libffi/archive/8fa8837.tar.gz
[INFO]: libffi download already cached, skipping
[INFO]: <- directory context /home/adrian
[INFO]: Downloading openssl
[INFO]: -> running mkdir -p /home/adrian/.local/share/python-for-android/packages/openssl
[INFO]: -> directory context /home/adrian/.local/share/python-for-android/packages/openssl
[INFO]: -> running basename https://www.openssl.org/source/openssl-1.1.1f.tar.gz
[INFO]: openssl download already cached, skipping
[INFO]: <- directory context /home/adrian
[INFO]: Downloading sdl2_image
[INFO]: -> running mkdir -p /home/adrian/.local/share/python-for-android/packages/sdl2_image
[INFO]: -> directory context /home/adrian/.local/share/python-for-android/packages/sdl2_image
[INFO]: -> running basename https://www.libsdl.org/projects/SDL_image/release/SDL2_image-2.0.4.tar.gz
[INFO]: sdl2_image download already cached, skipping
[INFO]: <- directory context /home/adrian
[INFO]: Downloading sdl2_mixer
[INFO]: -> running mkdir -p /home/adrian/.local/share/python-for-android/packages/sdl2_mixer
[INFO]: -> directory context /home/adrian/.local/share/python-for-android/packages/sdl2_mixer
[INFO]: -> running basename https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-2.0.4.tar.gz
[INFO]: sdl2_mixer download already cached, skipping
[INFO]: <- directory context /home/adrian
[INFO]: Downloading sdl2_ttf
[INFO]: -> running mkdir -p /home/adrian/.local/share/python-for-android/packages/sdl2_ttf
[INFO]: -> directory context /home/adrian/.local/share/python-for-android/packages/sdl2_ttf
[INFO]: -> running basename https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-2.0.14.tar.gz
[INFO]: sdl2_ttf download already cached, skipping
[INFO]: <- directory context /home/adrian
[INFO]: Downloading sqlite3
[INFO]: -> running mkdir -p /home/adrian/.local/share/python-for-android/packages/sqlite3
[INFO]: -> directory context /home/adrian/.local/share/python-for-android/packages/sqlite3
[INFO]: -> running basename https://www.sqlite.org/2016/sqlite-amalgamation-3150100.zip
[INFO]: sqlite3 download already cached, skipping
[INFO]: <- directory context /home/adrian
[INFO]: Downloading python3
[INFO]: -> running mkdir -p /home/adrian/.local/share/python-for-android/packages/python3
[INFO]: -> directory context /home/adrian/.local/share/python-for-android/packages/python3
[INFO]: -> running basename https://www.python.org/ftp/python/3.8.1/Python-3.8.1.tgz
[INFO]: python3 download already cached, skipping
[INFO]: <- directory context /home/adrian
[INFO]: Downloading sdl2
[INFO]: -> running mkdir -p /home/adrian/.local/share/python-for-android/packages/sdl2
[INFO]: -> directory context /home/adrian/.local/share/python-for-android/packages/sdl2
[INFO]: -> running basename https://www.libsdl.org/release/SDL2-2.0.9.tar.gz
[INFO]: sdl2 download already cached, skipping
[INFO]: <- directory context /home/adrian
[INFO]: Downloading setuptools
[INFO]: -> running mkdir -p /home/adrian/.local/share/python-for-android/packages/setuptools
[INFO]: -> directory context /home/adrian/.local/share/python-for-android/packages/setuptools
[INFO]: -> running basename https://pypi.python.org/packages/source/s/setuptools/setuptools-40.9.0.zip
[INFO]: -> running rm -f .mark-setuptools-40.9.0.zip
[INFO]: Downloading setuptools from https://pypi.python.org/packages/source/s/setuptools/setuptools-40.9.0.zip
Download failed retrying in a second...Download failed retrying in a second...Download failed retrying in a second...Download failed retrying in a second...Traceback (most recent call last):
File "/usr/lib/python3.6/urllib/request.py", line 1764, in open
return getattr(self, name)(url)
File "/usr/lib/python3.6/urllib/request.py", line 1974, in open_https
return self._open_generic_http(self._https_connection, url, data)
File "/usr/lib/python3.6/urllib/request.py", line 1923, in _open_generic_http
http_conn.request("GET", selector, headers=headers)
File "/usr/lib/python3.6/http/client.py", line 1264, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/lib/python3.6/http/client.py", line 1310, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/usr/lib/python3.6/http/client.py", line 1259, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/lib/python3.6/http/client.py", line 1038, in _send_output
self.send(msg)
File "/usr/lib/python3.6/http/client.py", line 976, in send
self.connect()
File "/usr/lib/python3.6/http/client.py", line 1425, in connect
server_hostname=server_hostname)
File "/usr/lib/python3.6/ssl.py", line 407, in wrap_socket
_context=self, _session=session)
File "/usr/lib/python3.6/ssl.py", line 817, in init
self.do_handshake()
File "/usr/lib/python3.6/ssl.py", line 1077, in do_handshake
self._sslobj.do_handshake()
File "/usr/lib/python3.6/ssl.py", line 689, in do_handshake
self._sslobj.do_handshake()
OSError: [Errno 0] Error

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/adrian/.local/bin/p4a", line 11, in
sys.exit(main())
File "/home/adrian/.local/lib/python3.6/site-packages/pythonforandroid/entrypoints.py", line 18, in main
ToolchainCL()
File "/home/adrian/.local/lib/python3.6/site-packages/pythonforandroid/toolchain.py", line 688, in init
getattr(self, command)(args)
File "/home/adrian/.local/lib/python3.6/site-packages/pythonforandroid/toolchain.py", line 154, in wrapper_func
build_dist_from_args(ctx, dist, args)
File "/home/adrian/.local/lib/python3.6/site-packages/pythonforandroid/toolchain.py", line 208, in build_dist_from_args
args, "ignore_setup_py", False
File "/home/adrian/.local/lib/python3.6/site-packages/pythonforandroid/build.py", line 551, in build_recipes
recipe.download_if_necessary()
File "/home/adrian/.local/lib/python3.6/site-packages/pythonforandroid/recipe.py", line 347, in download_if_necessary
self.download()
File "/home/adrian/.local/lib/python3.6/site-packages/pythonforandroid/recipe.py", line 393, in download
self.download_file(self.versioned_url, filename)
File "/home/adrian/.local/lib/python3.6/site-packages/pythonforandroid/recipe.py", line 208, in download_file
urlretrieve(url, target, report_hook)
File "/usr/lib/python3.6/urllib/request.py", line 1798, in retrieve
fp = self.open(url, data)
File "/usr/lib/python3.6/urllib/request.py", line 1770, in open
raise OSError('socket error', msg).with_traceback(sys.exc_info()[2])
File "/usr/lib/python3.6/urllib/request.py", line 1764, in open
return getattr(self, name)(url)
File "/usr/lib/python3.6/urllib/request.py", line 1974, in open_https
return self._open_generic_http(self._https_connection, url, data)
File "/usr/lib/python3.6/urllib/request.py", line 1923, in _open_generic_http
http_conn.request("GET", selector, headers=headers)
File "/usr/lib/python3.6/http/client.py", line 1264, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/lib/python3.6/http/client.py", line 1310, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/usr/lib/python3.6/http/client.py", line 1259, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/lib/python3.6/http/client.py", line 1038, in _send_output
self.send(msg)
File "/usr/lib/python3.6/http/client.py", line 976, in send
self.connect()
File "/usr/lib/python3.6/http/client.py", line 1425, in connect
server_hostname=server_hostname)
File "/usr/lib/python3.6/ssl.py", line 407, in wrap_socket
_context=self, _session=session)
File "/usr/lib/python3.6/ssl.py", line 817, in init
self.do_handshake()
File "/usr/lib/python3.6/ssl.py", line 1077, in do_handshake
self._sslobj.do_handshake()
File "/usr/lib/python3.6/ssl.py", line 689, in do_handshake
self._sslobj.do_handshake()
OSError: [Errno socket error] [Errno 0] Error

@AndreMiras
Copy link
Member

What happens when you try to wget it manually?

@adriankokai
Copy link
Author

here is what I got:

adrian@DESKTOP-SURCTH0:~$ wget https://pypi.python.org/packages/source/s/setuptools/setuptools-40.9.0.zip
Will not apply HSTS. The HSTS database must be a regular and non-world-writable file.
ERROR: could not open HSTS store at '/home/adrian/.wget-hsts'. HSTS will be disabled.
--2020-05-14 12:38:21-- https://pypi.python.org/packages/source/s/setuptools/setuptools-40.9.0.zip
Resolving pypi.python.org (pypi.python.org)... 151.101.172.223, 2a04:4e42:29::223
Connecting to pypi.python.org (pypi.python.org)|151.101.172.223|:443... connected.
HTTP request sent, awaiting response... 301 Redirect to Primary Domain
Location: https://pypi.org/packages/source/s/setuptools/setuptools-40.9.0.zip [following]
--2020-05-14 12:38:21-- https://pypi.org/packages/source/s/setuptools/setuptools-40.9.0.zip
Resolving pypi.org (pypi.org)... 151.101.64.223, 151.101.0.223, 151.101.128.223, ...
Connecting to pypi.org (pypi.org)|151.101.64.223|:443... connected.
HTTP request sent, awaiting response... ^[[A301 Moved Permanently
Location: https://files.pythonhosted.org/packages/source/s/setuptools/setuptools-40.9.0.zip [following]
--2020-05-14 12:38:21-- https://files.pythonhosted.org/packages/source/s/setuptools/setuptools-40.9.0.zip
Resolving files.pythonhosted.org (files.pythonhosted.org)... 151.101.173.63, 2a04:4e42:29::319
Connecting to files.pythonhosted.org (files.pythonhosted.org)|151.101.173.63|:443... connected.
Unable to establish SSL connection.

@AndreMiras
Copy link
Member

OK so that's a problem at your host level I think. Or maybe the server the load balancer redirects you to.
I mean it's not a p4a specific issue since wget is also showing this problem. Try to google that problem and see

@adriankokai
Copy link
Author

adriankokai commented May 14, 2020 via email

@adriankokai
Copy link
Author

I used a different ISP and everything went well.

@adriankokai
Copy link
Author

I used a different ISP and everything went well.

@AndreMiras
Copy link
Member

Interesting, thanks for the update

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

2 participants