hbp@pop-os:~$ pip3 install Django
Defaulting to user installation because normal site-packages is not writeable
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/django/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/django/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/django/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/django/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/django/
Could not fetch URL https://pypi.org/simple/django/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/django/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
ERROR: Could not find a version that satisfies the requirement Django (from versions: none)
ERROR: No matching distribution found for Django
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
hbp@pop-os:~$
可能是什么问题?? Python版本:3.8.5 点:20.1.1
答案 0 :(得分:0)
第2步-安装Python 1. sudo apt-get更新&& sudo apt-get -y升级 2. sudo apt-get安装python3。 3. sudo apt-get install -y python3-pip。
第2步-安装virtualenv 1.pip3安装virtualenv。 2.virtualenv --version。
第3步-安装Django
选项1:在virtualenv中安装Django。 当您需要将Django版本与服务器的全局环境隔离时,这是理想的选择。
选项2:从源代码安装Django。 如果您需要最新的软件或想要比Ubuntu APT存储库所提供的软件更新的产品,则可以直接从源代码进行安装。请注意,如果您希望软件的版本是最新的,则选择这种安装方法需要不断的关注和维护。
选项3:使用pip全局安装Django。 我们要使用的选项是pip 3,因为我们将在全球范围内安装Django。
步骤4 1. mkdir django-apps 2.cd django-apps 3.激活虚拟。=> virtualenv env 4 .. env / bin / activate 5.pip安装django
第4步-创建Django测试项目 1. django-admin startproject测试站点 2.cd测试站点 3.ls 4.manage.py运行服务器