Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/jenkins/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 3.x ModuleNotFoundError:没有名为';请求';在Jenkins中使用pyinstaller_Python 3.x_Jenkins_Python Requests_Pyinstaller_Dsl - Fatal编程技术网

Python 3.x ModuleNotFoundError:没有名为';请求';在Jenkins中使用pyinstaller

Python 3.x ModuleNotFoundError:没有名为';请求';在Jenkins中使用pyinstaller,python-3.x,jenkins,python-requests,pyinstaller,dsl,Python 3.x,Jenkins,Python Requests,Pyinstaller,Dsl,我目前正在使用Jenkins管道来自动化我的应用程序的构建、测试和交付阶段。我正在尝试使用Python3中的请求库。在PyCharm中,我的程序运行得非常好,但是在完成交付阶段后,我得到了ModuleNotFoundError:No module named'requests'错误,运行.exe。我尝试在通过Jenkins文件运行的pyinstaller脚本中隐藏导入请求模块,并尝试升级/降级pyinstaller和请求。我错过什么了吗?下面是我的管道交付阶段的代码 stage('Deliver

我目前正在使用Jenkins管道来自动化我的应用程序的构建、测试和交付阶段。我正在尝试使用
Python3
中的
请求
库。在PyCharm中,我的程序运行得非常好,但是在完成交付阶段后,我得到了
ModuleNotFoundError:No module named'requests'
错误,运行
.exe
。我尝试在通过Jenkins文件运行的pyinstaller脚本中隐藏导入请求模块,并尝试升级/降级pyinstaller和请求。我错过什么了吗?下面是我的管道交付阶段的代码

stage('Deliver') { 
    agent any
    environment { 
        VOLUME = '$(pwd):/src/'
        IMAGE = 'cdrx/pyinstaller-windows:python3'
    }
    steps {
        dir(path: env.BUILD_ID) { 
            unstash(name: 'compiled-results') 
            sh "docker run --rm -v ${VOLUME} ${IMAGE} 'pyinstaller -F pollut_api.py --hidden-import requests -y'" 
        }
    }
    post {
        success {
            archiveArtifacts "${env.BUILD_ID}/dist/*" 
            sh "docker run --rm -v ${VOLUME} ${IMAGE} 'rm -rf build dist'"
        }
    }
}