简体   繁体   中英

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:~$

What could be the problem?? Python Version: 3.8.5 pip: 20.1.1

Step 2 — Install 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.

Step 2 — Install virtualenv 1.pip3 install virtualenv. 2.virtualenv --version.

Step 3 — Install Django

Option 1: Install Django within a virtualenv. This is ideal for when you need your version of Django to be isolated from the global environment of your server.

Option 2: Install Django from Source. If you want the latest software or want something newer than what your Ubuntu APT repository offers, you can install directly from source. Note that opting for this installation method requires constant attention and maintenance if you want your version of the software to be up to date.

Option 3: Install Django Globally with pip. The option we are going with is pip 3 as we will be installing Django globally.

Step 4 1.mkdir django-apps 2.cd django-apps 3. Activate virtual.=> virtualenv env 4.. env/bin/activate 5.pip install django

Step 4 — Creating a Django Test Project 1.django-admin startproject testsite 2.cd testsite 3.ls 4.manage.py runserver

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM