1

I do not know how to fix this, any help is appreciated. Thanks in advance -J

I have tried various ways of installing and importing matplotlib (though command prompt, the text editor I've been using (geany). and neither option has worked. I've also installed the .whl file from https://matplotlib.org/ and it still has not worked (gives the same error)

I originally used the code:

import matplotlib.pyplot as plt

in my text editor (geany) to install matplotlib but this gave the error shown below

Expected Results:

I expect it to import and install the right version of matplotlib (I think the right version for me is matplotlib 3.0 because I'm using python 3.7).

Actual Results:

When I type 'python -m pip install -U matplotlib' into my command prompt (I'm on windows 10, using python 3.7) it displays:

WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1056)'))': /simple/matplotlib/

and repeats the message for a total of 5 times then displays:

Could not fetch URL https://pypi.org/simple/matplotlib/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/matplotlib/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1056)'))) - skipping

and finishes with the error:

ERROR: Could not find a version that satisfies the requirement matplotlib (from versions: none)
ERROR: No matching distribution found for matplotlib 

I have tried to fix this SSLError but I haven't made any progress in this simply because I don't know where to start.

Thanks again for any help

Louis 'LYRO' Dupont
  • 1,052
  • 4
  • 15
  • 35
Jeffery
  • 11
  • 1
  • 2

3 Answers3

0

From this topic:

You should add the pypi host to the list of trusted host. To do so, enter those commands:

pip install --trusted-host pypi.python.org pytest-xdist
pip install --trusted-host pypi.python.org --upgrade pip
Louis 'LYRO' Dupont
  • 1,052
  • 4
  • 15
  • 35
  • Hey @ Safran , thanks for the answer but the command prompt is still giving me the SSL error like before. Do you know if I should reinstall or re-verify a SSL certificate? – Jeffery May 28 '19 at 13:29
  • @Jeffery If you are behind some firewall this might be the reason. There should be no need to re-verify a SSL certificate. You should take a look at the link I provided, some other options are described here. – Louis 'LYRO' Dupont May 28 '19 at 14:23
0

This could happen if you're behind a firewall and console is blocked from internet. You can download the package to local and run

python -m pip --install -e /path/to/package/folder

or download the wheel file and run

python -m pip install /path/to/wheel_file.whl
Quang Hoang
  • 146,074
  • 10
  • 56
  • 74
  • Hey Quang,it is telling me that ```no such option: --install``` after I put in ```python -m pip --install /path/to/wheel_file.whl``` (but obviously with the actual path and file name) – Jeffery May 28 '19 at 13:44
  • @Jeffery my mistake. It should just be `python -m pip install /path/to/wheel_file.whl`. Updating. – Quang Hoang May 28 '19 at 14:43
  • this gave me a new error, ```ERROR: Could not find a version that satisfies the requirement kiwisolver>=1.0.1 (from matplotlib==3.1.0) (from versions: none) ERROR: No matching distribution found for kiwisolver>=1.0.1 (from matplotlib==3.1.0)``` Thanks for your continued help – Jeffery May 28 '19 at 14:56
  • You could do the same thing (download wheel, install locally) for all the missing requirements. – Quang Hoang May 28 '19 at 15:14
0

A huge thank you to @Louis 'LYRO' Dupont and @Quang Hoang for helping me work through this. What I ended up doing was going to pypi.python.org and downloading all of the requirements as .whl files in order to run matplotlib. This took a bit of work as I had to try to install matplotlib after installing each requirement to see what the next one I needed was. Thanks again to both you guys and have a nice week!

Jeffery
  • 11
  • 1
  • 2