我该如何解决? 在Python?

问题描述 投票:0回答:1

我有一个Django Web应用程序,当我使用Conda安装Python时,它曾经工作过。我最近卸载了Conda并定期安装我所有的Python软件包。我正在尝试在本地服务器上运行我的Django应用程序,它不再有效。我发现问题是这个错误:

URLError at /submit/
<urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:833)>
Request Method: POST
Request URL:    http://127.0.0.1:8000/submit/
Django Version: 2.1.1
Exception Type: URLError
Exception Value:    
<urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:833)>
Exception Location:  /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py in do_open, line 1320
Python Executable:  /Library/Frameworks/Python.framework/Versions/3.6/bin/python3
Python Version: 3.6.5

我知道有一些关于Python 3.6证书的更新(参见this article的底部)。我希望找到一个简单的修复程序,让我继续在本地主机上运行这个Django应用程序,我希望继续使用没有Conda的Python 3.6。我可以尝试使用安装了不同版本Python的virtualenv,但我想知道我是否仍然可以使用3.6。任何见解都表示赞赏!

python django ssl localhost python-3.6
1个回答
1
投票

this post的第二个解决方案为我解决了这个问题。

我试过pip install --upgrade certifi,但这并没有解决它。运行/Applications/Python 3.6/Install Certificates.command脚本,它本身运行pip install --upgrade certifi,以及其他一些东西,工作!

© www.soinside.com 2019 - 2024. All rights reserved.