我试图创造一个虚拟的环境,我能够在过去做的诗歌安装。但是现在,当我尝试做一个poetry install
时,我会收到这样的消息:
Max retries exceeded with url: /pypi/six/1.16.0/json (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)')))
at ~/.poetry/lib/poetry/_vendor/py3.9/requests/adapters.py:514 in send
510│ raise ProxyError(e, request=request)
511│
512│ if isinstance(e.reason, _SSLError):
513│ # This branch is for urllib3 v1.22 and later.
→ 514│ raise SSLError(e, request=request)
515│
516│ raise ConnectionError(e, request=request)
517│
518│ except ClosedPoolError as e:
发布于 2022-03-08 06:25:16
Python的请求库似乎找不到您的证书。
是否配置了自签名证书的自定义存储库?,如果是的话,我还没有找到一个很好的解决这个问题的方法。在这种情况下,请查看是否设置了CURL_CA_BUNDLE环境变量:
$ echo $CURL_CA_BUNDLE
如果这指向某个自定义位置/自签名证书,则请求无法使用其标准证书包。您可以取消它(可能会对使用它的服务产生副作用):
出口CURL_CA_BUNDLE="“
如果没有配置任何自定义存储库/证书,则为:
您也许可以通过安装证书来解决这个问题。
发布于 2022-09-21 19:28:17
什么对我有效(MacOS)转到应用程序> Python文件夹>双击“安装Certificates.command”文件
发布于 2022-08-26 23:24:06
Python3.7安装在MacOSX系统上时,需要运行一个脚本,通过bash在您的系统上安装系统上的证书依赖项。
#!/bin/sh
/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 << "EOF"
# install_certifi.py
#
# sample script to install or update a set of default Root Certificates
# for the ssl module. Uses the certificates provided by the certifi package:
# https://pypi.org/project/certifi/
import os
import os.path
import ssl
import stat
import subprocess
import sys
STAT_0o775 = ( stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR
| stat.S_IRGRP | stat.S_IWGRP | stat.S_IXGRP
| stat.S_IROTH | stat.S_IXOTH )
def main():
openssl_dir, openssl_cafile = os.path.split(
ssl.get_default_verify_paths().openssl_cafile)
print(" -- pip install --upgrade certifi")
subprocess.check_call([sys.executable,
"-E", "-s", "-m", "pip", "install", "--upgrade", "certifi"])
import certifi
# change working directory to the default SSL directory
os.chdir(openssl_dir)
relpath_to_certifi_cafile = os.path.relpath(certifi.where())
print(" -- removing any existing file or link")
try:
os.remove(openssl_cafile)
except FileNotFoundError:
pass
print(" -- creating symlink to certifi certificate bundle")
os.symlink(relpath_to_certifi_cafile, openssl_cafile)
print(" -- setting permissions")
os.chmod(openssl_cafile, STAT_0o775)
print(" -- update complete")
if __name__ == '__main__':
main()
EOF
这是bash脚本的内容,该脚本安装证书包ssl证书。它还应该位于应用程序中安装的Python文件夹中。
cd /Applications/Python\ 3.7/
./Install\ Certificates.command
https://stackoverflow.com/questions/69814872
复制相似问题