[pipenv] Error trying to install numpy

I currently follow the video for the virtual environments and installation of pipenv.
This all worked so far.

Versions installed:
Operating System: Windows 10
Python = Python3.9
pip = 21.0.1
pipenv = version 2020.11.15

Creating the environment on my D drive worked all good, but then I ran into trouble when I wanted to install numpy.
This is the error it showed for me:

>>> pipenv install numpy
Installing numpy...
Error:  An error occurred while installing numpy!
Error text: Could not fetch URL https://pypi.org/simple/numpy/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/numpy/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping

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/numpy/
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/numpy/
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/numpy/
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/numpy/
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/numpy/
ERROR: Could not find a version that satisfies the requirement numpy
ERROR: No matching distribution found for numpy

Installation Failed

Funny enough, the installation with pip worked:

>>> pip install numpy
Collecting numpy
  Downloading numpy-1.20.1-cp39-cp39-win_amd64.whl (13.7 MB)
     |████████████████████████████████| 13.7 MB ...
Installing collected packages: numpy
Successfully installed numpy-1.20.1

But even afterwards, the numpy installation with pipenv did not work with the same errors.

Does anyone have an idea why it does not work and what I can do to install numpy with pipenv on the environment?

Thank you for your help.

From what I see, it couldn’t fetch the URL or find a version that satisfies the requirement numpy. I don’t know how to fix this, but all I suggest is try to reinstall it off of a different browser

It seems to be missing a module to run ssl "because the SSL module is not available". I’d suggest having a web search centred around that issue as it may (no guarantee) be a simple fix.

1 Like

Thank you for the advise, but I did not use a browser, but cmd for that.

Yes, I checked a few similar issues and some suggested to update the pip, however the command given (pip --update) threw an error, that this is an unknown command.

All the examples I found were however a year old or older and with much earlier versions of both pip and pipenv.

The only thing I could think of is, that it is because of a block on my router (not the actual router, but it seems my provider has a firewall in the fibre modem, which can’t be ,modified, that is between router and internet, because I also had issues with some hosting services like Maptools).

I find it weird though, that it worked for pip but not for pipenv.

I’d still hazard a guess the issue is somewhere with the site packages (either problems with the install or the path) but it might be a pain to solve. If you’re looking to update pip itself then pip install --upgrade pip should do the job, check the man pages and pip --help if you’re unsure as it’s true that --update is not a valid pip command (at least in more recent versions).

If you’re still stuck then perhaps you could simply work with pip and venv, the standard modules until you find a solution. If you’re not working on a complex project with multiple dependencies then it’s unlikely you’d need a dependency resolutin manager as strong as pipenv and several tools can be found on pypi and installed via pip which help manage dependency issues or work as alternative full managers like poetry.