我正在尝试使用pipenv安装依赖项,我的Jenkinsfile
如下
pipeline {
agent any
stages{
stage('Install dependencies') {
steps {
echo 'Install dependencies'
sh 'python3 --version'
sh 'pip3 install pipenv==2022.5.2'
sh 'pipenv --rm || exit 0'
sh 'pipenv install'
}
}
但是我得到了以下错误
(管道)sh
使用/usr/bin/python3.8(3.8.10)创建虚拟环境…/usr/bin/python3模块名为pipenv.pewVirtualenv location: Traceback(最近一次调用):File/usr/bin/pipenv",第11行load_entry_point('pipenv==11.9.0', 'console_scripts', 'pipenv')() File "/usr/lib/python3/dist-packages/pipenv/vendor/click/core.py",第722行,在中调用回归自我。main(*args, **kwargs) File "/usr/lib/python3/dist-packages/pipenv/vendor/click/core.py"697, in mainrv = self.invoke(ctx) File "/usr/lib/python3/dist-packages/pipenv/vendor/click/core.py"1066,在调用文件"/usr/lib/python3/dist-packages/pipenv/vendor/click/core.py"在调用中返回ctx.invoke(自我。File "/usr/lib/python3/dist-packages/pipenv/vendor/click/core.py"在调用中文件"/usr/lib/python3/dist-packages/pipenv/cli.py",第349行,安装核心。do_install(File "/usr/lib/python3/dist-packages/pipenv/core.py",第1755行,indo_installensure_project(File "/usr/lib/python3/dist-packages/pipenv/core.py",第616行,inensure_project'{0}:您的Pipfile需要{1}{2},' TypeError:str返回的非字符串(类型NoneType)
我正在使用Python 3.8
,我正在运行jenkins
在我的本地机器(Ubuntu 20.04)
是版本问题还是我需要添加特定的jenkins插件?如有任何建议,请参考
我使用了以下命令
pipeline {
agent { label 'python3'}
stages{
stage('Install dependencies') {
steps {
echo('....Install dependencies & Create VirtualEnvironment ..')
sh 'pip3 install --user pipenv'
sh 'pipenv --rm || exit 0'
sh 'pipenv install --pre --dev'
}
}
注意:我使用的是python3.9
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
pyspark= "==3.2.1"
boto3= "*"
botocore= "*"
[dev-packages]
pytest= "==7.1.2"
pytest-spark= "==0.6.0"
coverage= "==4.5.3"
pylint= "==2.13.9"
mypy= "==0.960"
pydocstyle= "==6.1.1"
[requires]
python_version = "3.9"
[pipenv]
allow_prereleases = true