jenkins里跑pipenv install 报错 pipenv 命令找不到
steps{
                script{
                    sh 'pwd'
                    dir('api'){
                        withPythonEnv('/usr/bin/python3.7') {
                            echo 'Python 3.7'
                            dir('db') {
                                sh "docker container rm -f db | true"
                                sh "docker build -t db ."
                                sh "docker container run -d -p 5432:5432 --name db -e POSTGRES_DB=seed-to-sale-development -e POSTGRES_API_USER=api_server -e POSTGRES_PASSWORD=seed2sale db"
                            }
                            sleep 15
                            sh "docker container logs db"
                            sh "pwd"
                            sh 'python3 --version'
                            sh 'pip3 install pipenv'
                            sh 'pipenv --rm || exit 0'
                            sh 'pipenv install --pre --dev'
                            sh "pipenv run bash -c 'PIPENV_DOTENV_LOCATION=test.env pipenv run alembic upgrade d97679384caf && PIPENV_DOTENV_LOCATION=test.env pipenv run alembic upgrade head'"
                            sh "pipenv run pytest -v -o junit_family=xunit1 --cov=. --cov-report xml:coverage.xml  --junitxml=nosetests.xml"
                            sh 'ls *.xml'
                            sh "docker container rm -f db"
                        }
                    }
                }
            }这是一段python test代码,可以参考一下 大概就那样










