我刚刚重新安装了 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 版?
您无需更新pip
即可查找新软件包。它在 PyPI 上查找它们。
Django 3.0 需要 Python 3.6 或更高版本。Ubuntu 16.04 的python3
软件包适用于 3.5. 版本,它由 Django 2.2 支持。
要么升级您的 Python(我建议使用类似pyenv
或pythonz
轻松地将您的 Python 版本与您的操作系统分离)或使用 Django 2.2。
归档时间: |
|
查看次数: |
3492 次 |
最近记录: |