简体   繁体   English

为python3安装django时出现SSL错误

[英]SSL error when installing django for python3

$ pip3 install django

Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after 

connection broken by 'SSLError(SSLError(185090184, '[X509] no certificate or crl found (_ssl.c:3732)'),)': /simple/django/
  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(185090184, '[X509] no certificate or crl found (_ssl.c:3732)'),)': /simple/django/
  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(185090184, '[X509] no certificate or crl found (_ssl.c:3732)'),)': /simple/django/
  Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(185090184, '[X509] no certificate or crl found (_ssl.c:3732)'),)': /simple/django/
  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(185090184, '[X509] no certificate or crl found (_ssl.c:3732)'),)': /simple/django/
  Could not find a version that satisfies the requirement django (from versions: )
No matching distribution found for django

I have tried various solutions.我尝试了各种解决方案。 I installed python3.7 and then tried but same.我安装了python3.7,然后尝试但相同。 I also tried this but the result was also same.我也试过这个,但结果也是一样的。

$ sudo apt-get install python3-setuptools ca-certificates

and same thing happens when I install django in a venv.当我在 venv 中安装 django 时,也会发生同样的事情。 Same goes for the installing a specific version of django.安装特定版本的 django 也是如此。

我正在使用 Ubuntu,但是,我通过运行更新解决了这个问题,然后修复了 dpkg configure -a,它似乎安装了所有证书,然后升级。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM