Ubuntu Linux 上的 Django:“找不到满足要求的版本”

Ubuntu Linux 上的 Django:“找不到满足要求的版本”

尝试在 Linux Ubuntu 上安装 django(通过虚拟机)。Python3、pip3 已成功安装(因为我可以在我的计算机上成功验证每个版本的版本)。

   > sudo apt-get install python3 python3-pip
Reading package lists... Done
Building dependency tree       
Reading state information... Done
python3 is already the newest version (3.6.7-1~18.04).
python3-pip is already the newest version (9.0.1-2.3~ubuntu1.18.04.1).
0 upgraded, 0 newly installed, 0 to remove and 332 not upgraded.

当我尝试安装 django 时,显示此错误消息。

    > pip3 install Django
Collecting Django
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f1fe92a5b70>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /simple/django/
  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f1fe92a5d30>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /simple/django/
  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f1fe92a5cc0>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /simple/django/
  Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f1fe92a5f60>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /simple/django/
  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f1fe92a5e10>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /simple/django/
  Could not find a version that satisfies the requirement Django (from versions: )
No matching distribution found for Django

对 Linux 故障排除有点陌生;欢迎提供反馈!

答案1

如果你看一下错误消息的最后一行No matching distribution found for Django- 它说pip3找不到名为的发行版Django。这是因为发行版名称区分大小写。

你想要的是pip3 install django

模块django全部小写。

相关内容