在 Ubuntu 16.04 上找不到与 django==3.0 匹配的发行版

hug*_*ugh 4 python django pip

我刚刚重新安装了 Ubuntu 16.04,然后创建了一个 virtualenv 并尝试安装 Django

sudo pip3 install django==3.0
Run Code Online (Sandbox Code Playgroud)

但这产生了以下错误:

ERROR: Could not find a version that satisfies the requirement django==3.0 
(from versions: 1.1.3, 1.1.4, 1.2, 1.2.1, 1.2.2, 1.2.3, 1.2.4, 1.2.5,
 1.2.6, 1.2.7, 1.3, 1.3.1, 1.3.2, 1.3.3, ...  2.2.5, 2.2.6, 2.2.7, 2.2.8, 2.2.9)
ERROR: No matching distribution found for django==3.0
Run Code Online (Sandbox Code Playgroud)

经过搜索,我觉得我的pip版本太低了,所以它不知道Django的新版本。我试图升级pip

sudo pip install --upgrade pip
Run Code Online (Sandbox Code Playgroud)

但这给了

WARNING: The directory '/home/hugh/.cache/pip' or 
its parent directory is not owned or is not writable by the current user. 
The cache has been disabled. Check the permissions and owner of that directory. 
If executing pip with sudo, you may want sudo's -H flag.
Requirement already up-to-date: pip in /usr/local/lib/python3.5/dist-packages (20.0.2)
Run Code Online (Sandbox Code Playgroud)

而且我知道pip的最新版本是 20.0.2。

为什么我不能安装 Django 3.0 版?

Chr*_*ris 6

您无需更新pip即可查找新软件包。它在 PyPI 上查找它们。

Django 3.0 需要 Python 3.6 或更高版本Ubuntu 16.04 的python3软件包适用于 3.5. 版本,它由 Django 2.2 支持

要么升级您的 Python(我建议使用类似pyenvpythonz轻松地将您的 Python 版本与您的操作系统分离)或使用 Django 2.2。