1

I'm trying to install Flask using pip. I've been following this tutorial, which instructs me to compile Python 3. pip install Flask gives an error that the SSL module is not available, then fails to install Flask.

While compiling, I had to sudo apt-get install zlib1g-dev to compile zlib. Do I have to install something to compile the SSL module too?

$ pip install flask
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Collecting flask
  Could not fetch URL https://pypi.python.org/simple/flask/: There was a problem confirming the ssl certificate: Can't connect to HTTPS URL because the SSL module is not availabe. - skipping
  Could not find a version that satisfies the requirement flask (from versions: )
No matching distribution found for flask
$
0

1 Answer 1

0

Most modern Linux distributions, including Mint, already have Python 3 installed, just run python3. If it is not installed, install it with sudo apt-get install python3 (or the equivalent for your distribution). You should not be compiling it yourself.

Create a virtualenv, then install Flask there.

mkdir myproject && cd myproject
python3 -m venv env
. env/bin/activate
pip install flask

If, for some reason, you still want to compile it yourself, then just as you had to install the development headers for zlib, you have to do the same for openssl (and a few others if you want a standard build). sudo apt-get install libssl-dev

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.