Deployment container when installing python dependency `pyrsistent` requires later version of Python

Hi, I didn’t find other related issues neother to the package, nor to container / deploy environment, so here we go.

On the Python dependencies installation process it throws following:

$ pip install awsebcli -q --upgrade
pyrsistent requires Python '>=3.5' but the running Python is 2.7.13
ERROR: Job failed: exit code 1

Complete log:

Running with gitlab-runner 13.4.0-rc1 (fd488787)
  on docker-auto-scale z3WU8uu-
Preparing the "docker+machine" executor
00:34
Using Docker executor with image node:12 ...
Pulling docker image node:12 ...
Using docker image sha256:bc72e39bf44c826c8754e25986c734071e6f17d438ca2bc17c7178bab92909e1 for node:12 with digest node@sha256:90df92115967a94e4522198e6e1e8d8a79ddaf8f74c798865a1ee9ac7f074cea ...
Preparing environment
00:05
Running on runner-z3wu8uu--project-14269981-concurrent-0 via runner-z3wu8uu--srm-1600074110-221fe019...
Getting source from Git repository
00:01
$ eval "$CI_PRE_CLONE_SCRIPT"
Fetching changes with git depth set to 50...
Initialized empty Git repository in /builds/intertempi/intertempi-api/.git/
Created fresh repository.
Checking out 8cb282b1 as master...
Skipping Git submodules setup
Restoring cache
00:12
Checking cache for default-1...
Downloading cache.zip from https://storage.googleapis.com/gitlab-com-runners-cache/project/14269981/default-1 
Successfully extracted cache
Executing "step_script" stage of the job script
$ apt-get -qq update -y
$ apt-get -qq install -o=Dpkg::Use-Pty=0 -y python-pip
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package libapparmor1:amd64.
(Reading database ... 29927 files and directories currently installed.)
Preparing to unpack .../00-libapparmor1_2.11.0-3+deb9u2_amd64.deb ...
Unpacking libapparmor1:amd64 (2.11.0-3+deb9u2) ...
Selecting previously unselected package dbus.
Preparing to unpack .../01-dbus_1.10.32-0+deb9u1_amd64.deb ...
Unpacking dbus (1.10.32-0+deb9u1) ...
Selecting previously unselected package build-essential.
Preparing to unpack .../02-build-essential_12.3_amd64.deb ...
Unpacking build-essential (12.3) ...
Selecting previously unselected package libdbus-glib-1-2:amd64.
Preparing to unpack .../03-libdbus-glib-1-2_0.108-2_amd64.deb ...
Unpacking libdbus-glib-1-2:amd64 (0.108-2) ...
Selecting previously unselected package libpython2.7:amd64.
Preparing to unpack .../04-libpython2.7_2.7.13-2+deb9u4_amd64.deb ...
Unpacking libpython2.7:amd64 (2.7.13-2+deb9u4) ...
Selecting previously unselected package libpython2.7-dev:amd64.
Preparing to unpack .../05-libpython2.7-dev_2.7.13-2+deb9u4_amd64.deb ...
Unpacking libpython2.7-dev:amd64 (2.7.13-2+deb9u4) ...
Selecting previously unselected package libpython-dev:amd64.
Preparing to unpack .../06-libpython-dev_2.7.13-2_amd64.deb ...
Unpacking libpython-dev:amd64 (2.7.13-2) ...
Selecting previously unselected package libpython-all-dev:amd64.
Preparing to unpack .../07-libpython-all-dev_2.7.13-2_amd64.deb ...
Unpacking libpython-all-dev:amd64 (2.7.13-2) ...
Selecting previously unselected package python-all.
Preparing to unpack .../08-python-all_2.7.13-2_amd64.deb ...
Unpacking python-all (2.7.13-2) ...
Selecting previously unselected package python2.7-dev.
Preparing to unpack .../09-python2.7-dev_2.7.13-2+deb9u4_amd64.deb ...
Unpacking python2.7-dev (2.7.13-2+deb9u4) ...
Selecting previously unselected package python-dev.
Preparing to unpack .../10-python-dev_2.7.13-2_amd64.deb ...
Unpacking python-dev (2.7.13-2) ...
Selecting previously unselected package python-all-dev.
Preparing to unpack .../11-python-all-dev_2.7.13-2_amd64.deb ...
Unpacking python-all-dev (2.7.13-2) ...
Selecting previously unselected package python-cffi-backend.
Preparing to unpack .../12-python-cffi-backend_1.9.1-2_amd64.deb ...
Unpacking python-cffi-backend (1.9.1-2) ...
Selecting previously unselected package python-crypto.
Preparing to unpack .../13-python-crypto_2.6.1-7_amd64.deb ...
Unpacking python-crypto (2.6.1-7) ...
Selecting previously unselected package python-enum34.
Preparing to unpack .../14-python-enum34_1.1.6-1_all.deb ...
Unpacking python-enum34 (1.1.6-1) ...
Selecting previously unselected package python-idna.
Preparing to unpack .../15-python-idna_2.2-1_all.deb ...
Unpacking python-idna (2.2-1) ...
Selecting previously unselected package python-ipaddress.
Preparing to unpack .../16-python-ipaddress_1.0.17-1_all.deb ...
Unpacking python-ipaddress (1.0.17-1) ...
Selecting previously unselected package python-pyasn1.
Preparing to unpack .../17-python-pyasn1_0.1.9-2_all.deb ...
Unpacking python-pyasn1 (0.1.9-2) ...
Selecting previously unselected package python-pkg-resources.
Preparing to unpack .../18-python-pkg-resources_33.1.1-1_all.deb ...
Unpacking python-pkg-resources (33.1.1-1) ...
Selecting previously unselected package python-setuptools.
Preparing to unpack .../19-python-setuptools_33.1.1-1_all.deb ...
Unpacking python-setuptools (33.1.1-1) ...
Selecting previously unselected package python-cryptography.
Preparing to unpack .../20-python-cryptography_1.7.1-3+deb9u2_amd64.deb ...
Unpacking python-cryptography (1.7.1-3+deb9u2) ...
Selecting previously unselected package python-dbus.
Preparing to unpack .../21-python-dbus_1.2.4-1+b1_amd64.deb ...
Unpacking python-dbus (1.2.4-1+b1) ...
Selecting previously unselected package python-gi.
Preparing to unpack .../22-python-gi_3.22.0-2_amd64.deb ...
Unpacking python-gi (3.22.0-2) ...
Selecting previously unselected package python-secretstorage.
Preparing to unpack .../23-python-secretstorage_2.3.1-2_all.deb ...
Unpacking python-secretstorage (2.3.1-2) ...
Selecting previously unselected package python-keyring.
Preparing to unpack .../24-python-keyring_10.1-1_all.deb ...
Unpacking python-keyring (10.1-1) ...
Selecting previously unselected package python-keyrings.alt.
Preparing to unpack .../25-python-keyrings.alt_1.3-1_all.deb ...
Unpacking python-keyrings.alt (1.3-1) ...
Selecting previously unselected package python-pip-whl.
Preparing to unpack .../26-python-pip-whl_9.0.1-2+deb9u2_all.deb ...
Unpacking python-pip-whl (9.0.1-2+deb9u2) ...
Selecting previously unselected package python-pip.
Preparing to unpack .../27-python-pip_9.0.1-2+deb9u2_all.deb ...
Unpacking python-pip (9.0.1-2+deb9u2) ...
Selecting previously unselected package python-wheel.
Preparing to unpack .../28-python-wheel_0.29.0-2_all.deb ...
Unpacking python-wheel (0.29.0-2) ...
Selecting previously unselected package python-xdg.
Preparing to unpack .../29-python-xdg_0.25-4_all.deb ...
Unpacking python-xdg (0.25-4) ...
Setting up python-idna (2.2-1) ...
Setting up python-pip-whl (9.0.1-2+deb9u2) ...
Setting up python-crypto (2.6.1-7) ...
Setting up build-essential (12.3) ...
Setting up libdbus-glib-1-2:amd64 (0.108-2) ...
Setting up python-pyasn1 (0.1.9-2) ...
Setting up python-wheel (0.29.0-2) ...
Setting up python-pkg-resources (33.1.1-1) ...
Setting up python-keyrings.alt (1.3-1) ...
Setting up python-cffi-backend (1.9.1-2) ...
Setting up python-gi (3.22.0-2) ...
Processing triggers for libc-bin (2.24-11+deb9u4) ...
Setting up libapparmor1:amd64 (2.11.0-3+deb9u2) ...
Setting up python-enum34 (1.1.6-1) ...
Setting up libpython2.7:amd64 (2.7.13-2+deb9u4) ...
Setting up libpython2.7-dev:amd64 (2.7.13-2+deb9u4) ...
Setting up dbus (1.10.32-0+deb9u1) ...
invoke-rc.d: could not determine current runlevel
invoke-rc.d: policy-rc.d denied execution of start.
Setting up python-dbus (1.2.4-1+b1) ...
Remove stale byte-compiled files...
Setting up python-ipaddress (1.0.17-1) ...
Setting up python-pip (9.0.1-2+deb9u2) ...
Setting up python2.7-dev (2.7.13-2+deb9u4) ...
Setting up python-all (2.7.13-2) ...
Setting up python-xdg (0.25-4) ...
Setting up libpython-dev:amd64 (2.7.13-2) ...
Setting up python-setuptools (33.1.1-1) ...
Setting up python-dev (2.7.13-2) ...
Setting up libpython-all-dev:amd64 (2.7.13-2) ...
Setting up python-all-dev (2.7.13-2) ...
Setting up python-cryptography (1.7.1-3+deb9u2) ...
Setting up python-secretstorage (2.3.1-2) ...
Setting up python-keyring (10.1-1) ...
Processing triggers for libc-bin (2.24-11+deb9u4) ...
$ pip install awsebcli -q --upgrade
pyrsistent requires Python '>=3.5' but the running Python is 2.7.13
ERROR: Job failed: exit code 1

What do we do now? Should we setup the environment somehow?

hey @o1dnik i’m having this same issue, it started to happening since one week ago, i tried from downgrading the awsebcli version to using a pre built image by circle cimg/python:3.7-node but nothing seems to help, have you fixed it already?

1 Like

hey @ReyRod I’m still looking for some hints about this. I just don’t want to spend too much time on this issue since it’s internal to Gitlab and the changes we wanted to deploy could wait a little bit. If you have urge to have a quick fix, I can only assume that you may try a custom container as mentioned here: https://docs.gitlab.com/ee/ci/docker/using_docker_images.html. Did you check it?

hey @o1dnik i was able to solve it, i installed python3 pip and then installed with pip3, here is my Install AWS dependencies job command:
sudo apt-get -y -qq update
sudo apt-get install python3-pip python3-dev build-essential
sudo pip3 install --upgrade setuptools
sudo pip3 install awsebcli --upgrade

hope it helps you