You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

无法安装django-constance,遇SSL证书验证及版本匹配错误

Fixing SSL TLSv1 Protocol Error When Installing django-constance

Looks like you're hitting a common issue with outdated pip versions not supporting modern TLS protocols. PyPI stopped accepting connections using TLSv1.0 and TLSv1.1 a while ago, which is why your install is failing with that SSL alert. Here's how to fix it:

The best long-term fix is to update your pip to a version that supports TLS 1.2+. Run this command:

pip3 install --upgrade pip

If this command also throws the same SSL error (since your current pip can't connect to PyPI securely), you can download the official get-pip.py script from the pip project's official sources, then run it with Python 3:

python3 get-pip.py

This will install the latest version of pip that supports modern TLS protocols. Once pip is updated, try installing django-constance again with pip3 install django-constance—it should work without issues.

Solution 2: Bypass SSL Verification Temporarily

If you can't upgrade pip right now, you can tell pip to trust PyPI's hosts during the install. This skips SSL verification for the package download:

pip3 install django-constance --trusted-host pypi.org --trusted-host files.pythonhosted.org

Note: This is a temporary workaround. Upgrading pip is still better for security and future package installs.

Why This Happens

Older versions of pip (prior to 9.0.1) don't support the TLS 1.2 protocol required by PyPI's current security standards. The error message [SSL: TLSV1_ALERT_PROTOCOL_VERSION] is PyPI's way of letting you know your connection is using an outdated, insecure protocol that's no longer allowed.

内容的提问来源于stack exchange,提问作者sof-03

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.27 04:06:08