[英]django installation: cannot use pip to install django on linux(ubuntu)
[英]Cannot install Django Framework on linux (PopOS - Ubuntu Based)
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
第 2 步 — 安裝 Python 1.sudo apt-get update && sudo apt-get -y upgrade 2.sudo apt-get install python3。 3.sudo apt-get install -y python3-pip。
步驟 2 — 安裝 virtualenv 1.pip3 install 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. 激活 virtual.=> virtualenv env 4.. env/bin/activate 5.pip install django
步驟 4 — 創建 Django 測試項目 1.django-admin startproject testsite 2.cd testsite 3.ls 4.manage.py runserver
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.