[英]Python error "NetworkError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661)
How it broke怎么破的
While troubleshooting my command line trying to ssh root@ip
into Docker, I seem to I have messed up with openssl
, somehow.在对尝试将ssh root@ip
到 Docker 中的命令行进行故障排除时,我似乎以某种方式搞砸了openssl
。
I can now connect to Docker, but I no longer can run scripts which require requests
.我现在可以连接到 Docker,但我不能再运行需要requests
脚本。
1st attempt第一次尝试
At first I did not know what was wrong.起初我不知道出了什么问题。
If I ran script.py
, it would just halt and fail silently.如果我运行script.py
,它只会停止并静默失败。
2nd attempt第二次尝试
Then I tried to run the same script from within a conda
env
, which has openssl
installed, and this time error was verbose, ending with:然后我尝试从安装了openssl
的conda
env
运行相同的脚本,这次错误很详细,以:
NetworkError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661)
openssl upgrade openssl 升级
I have then tried to upgrade it system-wide with brew upgrade openssl
, after which I got the following Caveats:然后我尝试使用brew upgrade openssl
在系统范围内升级它,之后我得到了以下警告:
A CA file has been bootstrapped using certificates from the SystemRoots
keychain. To add additional certificates (e.g. the certificates added in
the System keychain), place .pem files in
/usr/local/etc/openssl/certs
and run
/usr/local/opt/openssl/bin/c_rehash
and I did it.我做到了。
my .ssh/
has:我的.ssh/
有:
github_rsa
github_rsa.pub
id_boot2docker
id_boot2docker.pub
id_rsa
id_rsa.pub
known_hosts
the problem was a library called billboard.py
, being imported.问题是一个名为billboard.py
的库被导入。
this import was causing the problem and halting the program, and the reason needs further investigation.此导入导致问题并停止程序,原因需要进一步调查。
verbose Error was because conda env did not have all requeriments to run the program.详细错误是因为 conda env 没有运行程序的所有要求。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.