-1

Hello i'm using a Raspberry pi running Raspian Jessie. I've tried updating the python version to 3.8.1 and it seems I'm having troubles running pip with it.

After i enter this line in terminal

python3.8 -m pip install Flask

I keep getting the following error

WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. Collecting Flask 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=XXX): 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 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=XXX): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping

I've tried reinstalling python. And following other suggestions online. i even tried to get the ssl package manually. all with no luck. can someone please help?

  • 3
    Why are you still using Raspbian Jessie, it is out of date. Re-flash your sd card with Raspbian Buster. – CoderMike Jan 25 at 14:34
  • @CoderMike I wanted to try and make-do with the current O.S. . would the reflashing cause any damage to my sd? would there be any incompatability problems? is buster fully supported for bugs and issues? i've heard it came out very recently. – Mat brightington Jan 25 at 15:02
  • Re-flashing will overwrite everything on your sd card. Backup any files that you need first or use a new sd card. Re-flashing will not damage a card. Yes, Buster is fully supported, unlike Jessie. – CoderMike Jan 25 at 15:18
  • You have to backport python 3.8.1 to Jessie. – Ingo Jan 26 at 19:55
2

You have to install the SSL headers and libraries before compiling Python.

Either install them using sudo apt install libssl-dev, or (cross) compile them from source.

When running the Python configure script, check the output before compiling. It'll tell you what packages are missing.

|improve this answer|||||
  • thanks for answering! I checked and didn't see in the python configure script anything relating to ssl. also, it is telling me I already have the newest version of ilbssl-dev. am i missing something? – Mat brightington Jan 25 at 14:57
  • 1
    @Matbrightington as far as I know, Python 3.8.1 is not in the Raspbian repositories, so I presume you built it from source, is that correct? When building from source, you have to run the configure script, it'll find the necessary libraries and select the right compile options. – tttapa Jan 25 at 15:00
  • yes! I downloaded a tar file from the python site. after "cd"ing into the python folder extracted from the tar, i ran ./configure and make and make install. after i ran ./configure there was a huge list of packages, i tried finding the word ssl in there, but with no avail.. I've tried running that again a few times with different keywords. the first was ./configure with optimizations. – Mat brightington Jan 25 at 15:16
  • @Matbrightington do you have pkg-config installed? Try running pkg-config --libs openssl. – tttapa Jan 25 at 15:34
  • Write the output of configure to a file: ./configure | tee configure.output. Then open the configure.output and config.log in a text editor and search for "ssl". – tttapa Jan 25 at 15:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.