Skip to content
Advertisement

Trying to download python from a docker container while using GitLab CI

The last stage of my GitLab CI pipeline is a selenium test. I’m trying to automate it through GitLab CI:

quality_assurance_demo:
  stage: quality_assurance
  only:
    - demo
  environment:
    name: demo
    url: https://myapp.com
  script:
    - echo "Run Selenium Lambdatest"
    - apt-get update -y && apt-get install -y curl python3.6 python3-pip
    - pip install selenium requests pytest
    - pytest selenium/selenium_lambdatest.py

I have tried writing this a few different ways– not installing curl, installing everything on a different line… But every time I get this same result:

$ echo "Run Selenium Lambdatest"
Run Selenium Lambdatest
$ apt-get update -y && apt-get install -y curl python3.6 python3-pip
Get:1 http://security.debian.org/debian-security stretch/updates InRelease [53.0 kB]
Ign:2 http://deb.debian.org/debian stretch InRelease
Get:3 http://deb.debian.org/debian stretch-updates InRelease [93.6 kB]
Get:4 http://deb.debian.org/debian stretch Release [118 kB]
Get:5 http://deb.debian.org/debian stretch Release.gpg [2410 B]
Get:6 http://security.debian.org/debian-security stretch/updates/main amd64 Packages [529 kB]
Get:7 http://deb.debian.org/debian stretch-updates/main amd64 Packages [28.2 kB]
Get:8 http://deb.debian.org/debian stretch/main amd64 Packages [7083 kB]
Fetched 7907 kB in 1s (4486 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package python3.6
E: Couldn't find any package by glob 'python3.6'
E: Couldn't find any package by regex 'python3.6'
ERROR: Job failed: exit code 1

I understand that it is better to have a docker container pre-packaged with python and all the other stuff we need. But right now I am just trying to get these selenium tests working without messing around with any other stages of the CI pipeline or changing the starting container (node), although we may do that later. So without changing the container I am using, how can I get python and the dependencies installed?

Advertisement

Answer

Stretch does not contain Python 3.6. It only contains Python 3.5. Buster has Python 3.7 available. If you really need Python 3.6 you need to find a repository which has it available.

Advertisement