gpt4 book ai didi

python - 从 urllib3.util.ssl_ 导入(导入错误 : cannot import name ssl

转载 作者:行者123 更新时间:2023-12-03 17:44:54 27 4
gpt4 key购买 nike

我的资源:

Python 2.7、Ubunutu 18.04、Pycharm、虚拟框oracle

我有一个用 python 构建的自动化解决方案。
该解决方案可以从 cmd 运行或 pycharm当然。
2 个运行自动化解决方案的选项。

python main.py args a,b,c...(run 1 suite of tests)
python jenkinsRun.py arg a,b,c...(run main.py with diff args each time -lets say 5 time for instance)

曾经 jenkinsRun.py正在运行,它将执行每个 main.py像这样:
os.system('python main.py %s %s %s %s %s %s'%(STD,config.VpcStackName, '-dryrun', 'false', '-tenant' ,config.PROD_STAGE_Tenant))

请注意,这是我 3 年前实现它的方式......可能是使用 __import__ 等更好的方法,但需要方法来传递参数等...

无论如何,运行时:
python main.py arg a,b,c..

都好。

运行时:
jenkinsRun.py

每次都应该使用 diff args 运行 main 我得到异常:

"/home/ohad/.local/lib/python2.7/site-packages/botocore/httpsession.py", line 7, in <module>
from urllib3.util.ssl_ import (
ImportError: cannot import name ssl

仅当我在新环境中运行代码时才会发生这种情况(请参阅上面的资源)
上周我有一个带有 ubuntu 15.04(旧)的旧虚拟机,一切运行良好(从那以后就没有碰过 vode)。

我已经从头开始在新的虚拟机上安装了库、驱动程序等。

有任何想法吗?

最佳答案

可能是安装有问题。我确实在 MAC 上重新安装了它并且有效

sudo pip install awscli --ignore-installed six

关于python - 从 urllib3.util.ssl_ 导入(导入错误 : cannot import name ssl,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54217137/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com