0

I installed flask in my ubuntu. And in pipenv, I want to install Flask to run it. But it said below.

pip install flask
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/flask/
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/flask/
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/flask/
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/flask/
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/flask/
Could not fetch URL https://pypi.org/simple/flask/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/flask/ (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 flask (from versions: none)
ERROR: No matching distribution found for flask

I think this comes from the python path in ubuntu. When I print sys.path in python interpreter, it said below.

>>> import sys
>>> print(sys.path)
['', '/home/use/app/anaconda3/lib/python37.zip', 
'/home/use/app/anaconda3/lib/python3.7', 
'/home/use/app/anaconda3/lib/python3.7/lib-dynload', 
'/home/use/app/anaconda3/lib/python3.7/site-packages']

Does anyone help me to install Flask to run in pipenv. Thanks.

Peter
  • 127
  • 8
  • 1
    Use a [virtualenv](https://realpython.com/python-virtual-environments-a-primer/), it is easier to setup and it creates an isolated development environment. – kshitij86 Jun 14 '20 at 05:23
  • Maybe you have something similar to that https://stackoverflow.com/a/55632553/9515831 – Victor Jun 14 '20 at 06:32
  • To : Kshitij Using a virtualenv did work for me. Thanks! – Peter Jun 14 '20 at 10:57
  • To : Victor It looks same, but the answers are hard to understand. Thanks for comment. – Peter Jun 14 '20 at 10:58

0 Answers0