I found the solutions from Daniel F and mattdedek very helpful: use an https URL, and upgrade pip in order to make that the default. But that still didn't fix the problem for me. I had this error, under Mac OS X / Python 3.4:
$ pip3 install Flask
Downloading/unpacking Flask
Cannot fetch index base URL https://pypi.python.org/simple/
Could not find any downloads that satisfy the requirement Flask
Cleaning up...
No distributions at all found for Flask
Storing debug log for failure in /Users/huttarl/.pip/pip.log
and pip.log basically showed the same thing:
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pip/index.py", line 277, in find_requirement
raise DistributionNotFound('No distributions at all found for %s' % req)
pip.exceptions.DistributionNotFound: No distributions at all found for Flask
With help from a friend, I learned that upgrading from Python 3.4 to 3.8 fixed the problem. Apparently this is because one of the newer versions of Python 3 included updated certificates:
Certificate verification and OpenSSL
This package includes its own private copy of OpenSSL 1.1.1. The
trust certificates in system and user keychains managed by the
Keychain Access application and the security command line utility are
not used as defaults by the Python ssl module. A sample command
script is included in /Applications/Python 3.8 to install a curated
bundle of default root certificates from the third-party certifi
package (https://pypi.org/project/certifi/). Double-click on Install
Certificates to run it.
The bundled pip has its own default certificate store for verifying
download connections.
After this upgrade, and running Install Certificates.command
, the pip3 install Flask
runs successfully.
You may have already upgraded to Python 3.6+ in Mac OS, and just overlooked this certificate installation command. In that case, browse to Applications/Python 3.x and double-click Install Certificates.command
. (See Mac OSX python ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749))