pip can't find django 3.x - ERROR: No matching distribution found for django==3.0.4

pip can't find django 3.x - ERROR: No matching distribution found for django==3.0.4

当我运行:

pip3 install django==3.0.5

我收到错误

ERROR: Could not find a version that satisfies the requirement django==3.0.5 (from versions: 1.1.3, ... 2.2.11, 2.2.12) ERROR: No matching distribution found for django==3.0.4

我需要在某处更新一些参考资料,但我不确定如何更新。请帮助。

你打错版本了...官方最新版本是3.0.5。改为

pip install Django==3.0.5

了解更多信息 here


更新

在新评论能够看到您正在使用 Python 3.5 之后。事情是,根据 documentation,要使用 Django 版本 3.0.x,需要 Python 版本 3.6、3.7 或 3.8。

因此,作为 Linux 用户并假设您可以简单地更新到较新的版本,您可以使用带有以下命令的终端来获取 Python 的较新版本(例如, 3.7.0 版本)

sudo apt-get update && sudo apt-get upgrade
sudo apt-get install python3.7

如评论中所述,Django 3.x 是 only available for Python 3.6 or greater。如果您尝试在使用旧版本 Python 时安装 Django 3(例如,在 OP 的情况下为 Python 3.5),pip 将无法找到匹配的包。

解决方案是简单地升级到更现代的 Python 版本。

Python 该 Django 版本不支持您安装的版本。