Where to install python3-venv in project

Viewed 104

I am using a jenkins file to run the smoke tests

def runSmokeTest(environment) {
    docker.image("python:3.7").inside {
        withCredentials([usernamePassword(credentialsId: "inhome_smoketest_authz_${environment}",
         usernameVariable: 'CLIENT_ID', passwordVariable: 'CLIENT_SECRET')]) {
            sh "make smoketest CLIENT_ID=$CLIENT_ID CLIENT_SECRET=$CLIENT_SECRET ENV=${environment}"
        }
    }
}

In which I am getting below error

make smoketest CLIENT_ID=**** CLIENT_SECRET=**** ENV=acceptance
The virtual environment was not created successfully because ensurepip is not
available.  On Debian/Ubuntu systems, you need to install the python3-venv
package using the following command.

    apt-get install python3-venv

You may need to use sudo with that command.  After installing the python3-venv
package, recreate your virtual environment.

Failing command: ['/u01/app/jenkins/masters/jenkins-de-bcn-team-jenkins-master-6d64469c64-d5r87/workspace/de-inhome-smoketest/venv/bin/python3.7', '-Im', 'ensurepip', '--upgrade', '--default-pip']

And for creating virtual env we are using Makefile as follows

$(VENV_BASE):
    @rm -rf venv
    @$(PYTHON_VERSION) -m venv venv
    @touch $@

For smoke tests we have wriiten the following code in Makefile

.PHONY: smoketest
smoketest: $(VENV_PROD)
    venv/bin/python src/manage.py smoke_test --client_id=$(CLIENT_ID) --client_secret=$(CLIENT_SECRET) --env=$(ENV)

Can you please help where I can install the python3-venv?

0 Answers
Related