1

I am trying to install matplotlib into my windows 10 laptop but it is not working. I am following the instructions in the book "Python Crash course".

I am running Python 3.8.2 on windows 10.

When send the command via command prompt,

> python -m pip install --user matplotlib

I get the following messages.

*Microsoft Windows [Version 10.0.17763.1098]
(c) 2018 Microsoft Corporation. All rights reserved.
C:\Users\SGHCH>python -m pip install --user matplotlib
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 Proxy Authorization Required'))': /simple/matplotlib/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 Proxy Authorization Required'))': /simple/matplotlib/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 Proxy Authorization Required'))': /simple/matplotlib/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 Proxy Authorization Required'))': /simple/matplotlib/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 Proxy Authorization Required'))': /simple/matplotlib/
ERROR: Could not find a version that satisfies the requirement matplotlib (from versions: none)
ERROR: No matching distribution found for matplotlib
C:\Users\SGHCH>*

I downloaded

matplotlib-3.2.1-cp38-cp38-win32.whl

. After which, I navigated to the folder where this wheel was stored and tried to install it. The following are the messages I got in return.

*Microsoft Windows [Version 10.0.17763.1098]
(c) 2018 Microsoft Corporation. All rights reserved.
C:\Users\SGHCH>cd desktop
C:\Users\SGHCH\Desktop>cd python_book
C:\Users\SGHCH\Desktop\python_book>python -m pip install --user matplotlib-3.2.1-cp38-cp38-win32.whl
Processing c:\users\sghch\desktop\python_book\matplotlib-3.2.1-cp38-cp38-win32.whl
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 Proxy Authorization Required'))': /simple/pyparsing/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 Proxy Authorization Required'))': /simple/pyparsing/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 Proxy Authorization Required'))': /simple/pyparsing/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 Proxy Authorization Required'))': /simple/pyparsing/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 Proxy Authorization Required'))': /simple/pyparsing/
ERROR: Could not find a version that satisfies the requirement pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 (from matplotlib==3.2.1) (from versions: none)
ERROR: No matching distribution found for pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 (from matplotlib==3.2.1)
C:\Users\SGHCH\Desktop\python_book>*

I am also running all this from my company laptop. I am not sure if I have administrator rights.

Do I need administrator rights to install this wheel? If not, do you have any suggestion on how to solve this problem?

Regards, Adrian Chan

fanlix
  • 1,248
  • 1
  • 13
  • 22
  • It looks like a connection error. Is your Internet working properly? https://stackoverflow.com/questions/46466241/pip-install-failing-with-407-proxy-authentication-required – Sumit S Chawla Apr 14 '20 at 05:43
  • Hello Sam, Thanks for the input. I am using my company-managed internet. Is that a problem? I have downloaded the .whl file onto my laptop and run it using pip. Sorry, beginner here. Why do I need internet to install the .whl file that I downloaded? – Adrian Chan Apr 14 '20 at 05:58
  • Why not install directly using `pip install matplotlib`? – Underoos Apr 14 '20 at 06:06
  • @AdrianChan: If you check the error, it says that ```No matching distribution found for pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1``` in the second last line. That means it is using the internet for installing relative packages. – Sumit S Chawla Apr 14 '20 at 06:12
  • Hello Jarvis, I tried pip install matplotlib, but it does not work. please refer to m original (first) post. for the message that command promt returns. – Adrian Chan Apr 14 '20 at 06:21
  • Hello Sam. I shall try doing all this on another non-company laptop and see if that works then. – Adrian Chan Apr 14 '20 at 06:22
  • That definitely looks like an issue where your network is not allowing you to install matplotlib's dependencies. If you have a legitimate work-related reason for using Python, it's worth finding out how you can get your work machine configured to allow installing Python libraries. If not, a non-locked-down system should be pretty straightforward to set up. – japhyr Apr 14 '20 at 15:21
  • Hello Japhyr, indeed, I am behind a corporate network. When I installed it on a non-locked-down PC, everything worked perfectly. I shall use another PC then. Thanks! – Adrian Chan Apr 15 '20 at 03:26

1 Answers1

0

I will take the liberty to advise you to use the Conda package manager. Installing matplotlib looks similar:

conda install matplotlib

Difference between pip and conda

v_0ver
  • 167
  • 9
  • Hello. Thanks for the suggestion. It seems that the conda package manager only supports Python 3.7. I am using Python 3.8.2. I am reluctant to try this yet because when I installed Python 3.7.7, my other python projects did not work. I will come round to this if all else fails. – Adrian Chan Apr 14 '20 at 07:41
  • @v_Over, I cannot install the wheel because I am behind a corporate network. I was advised that installing all the dependencies for matplotlib individually might work. Do you think condo can help in my situation? – Adrian Chan Apr 15 '20 at 03:38
  • @v_Over, in the conda link you provided, I see that they only have downloads for python 3.7. I am running 3.8.2. Does conda support python 3.8.2? – Adrian Chan Apr 15 '20 at 03:39
  • @AdrianChan, sorry for the long answer, at the moment the conda supports python 3.8.4, the supported version of the python, as I understand it, is limited due to dependencies with other packages in the repository. I myself use miniconda on an isolated computer. First, I do all the necessary settings on a computer with Internet access, and then transfer the folder to the destination computer on the storage device. – v_0ver Jul 19 '20 at 22:11