I’ve got a an android project and I need to have python 3.7+ and pip on the command line. Xenial seems to be providing 3.4 (documentation says 3.5 but that’s not what I see), Focal 3.6, Bionic 3.2 (again, documentation says 3.6). Also, despite what the documentation says, the build works only when I don’t specify dist: trusty.
How do I go about installing python 3.7+ and pip?
What I tried:
-
addons: apt: sources: - deadsnakes packages: - python3.7This doesn’t come with
pip -
same, but with with packages like this:
packages: - python3.7-dev - python3-pipThis fails due to incompatibility between the two packages
-
packages: - python3.7-venv before_script: - python3.7 -m venv ~/venv - source ~/venv/bin/activateThis fails due to the following:
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Including
libssl-devorpython3-openssldoesn’t help. A similar error breaks the following:before_script: - curl https://bootstrap.pypa.io/get-pip.py | sudo python3.7 - -
packages: - python3.7-venv before_script: - python3.7 -m ensurepip --upgradeThis fails due to:
No module named ensurepip
-
before_script: - pyenv install --skip-existing 3.6.0 && pyenv global 3.6.0this works, but the highest stable version is somehow 3.6, and also this slows down the build considerably