jenkinsci / pyenv-pipeline-plugin

Execute commands in Python virtualenvs in Jenkins Pipeline DSL
https://plugins.jenkins.io/pyenv-pipeline/
MIT License
33 stars 15 forks source link

Error while creating virtualenv #49

Open menvol3 opened 1 year ago

menvol3 commented 1 year ago

Hi I was trying to use pyenv plugin on Linux Ubuntu slaves and received an error during the execution stage with installing the pip package

                stage('Collecting ansible') {
                    steps {
                        script {
                            withPythonEnv('python3') {
                                sh 'pip3 install ansible==2.9.0'
                            }
                        }
                    }
ERROR: Error while creating virtualenv: 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 install python3.8-venv

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

Failing command: ['/jenkins/workspace/infra-test-pip/.pyenv-python3/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']

Finished: FAILURE

Also, I was trying to run it on macOS slaves, and all steps were successful Do I need to install that python3-venv package?