Python Forum
How to install matplotlib? - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: General (https://python-forum.io/forum-1.html)
+--- Forum: News and Discussions (https://python-forum.io/forum-31.html)
+--- Thread: How to install matplotlib? (/thread-16788.html)



How to install matplotlib? - broccolee - Mar-14-2019

Hi,

I get the following error when I tried to install matplotlib:

/* -----------------------------------------------------------------------

Installing collected packages: numpy, pyparsing, matplotlib
Found existing installation: numpy 1.5.1
Cannot uninstall 'numpy'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
----- Failed to install 'matplotlib' -----

---------------*/

How can I troubleshoot this?

Thanks.


RE: How to install matplotlib? - snippsat - Mar-14-2019

pip uninstall numpy
Then:
pip install matplotlib
If i do a quick with virtual environment,venv is now build into Python.
Then do pip freeze after install.
(install_env) C:\code\install_env   
λ pip freeze                        
cycler==0.10.0                      
kiwisolver==1.0.1                   
matplotlib==3.0.3                   
numpy==1.16.2                       
pyparsing==2.3.1                    
python-dateutil==2.8.0              
six==1.12.0
You see that pip install matplotlib automatic install a never version that numpy 1.5.


RE: How to install matplotlib? - broccolee - Mar-15-2019

Hi Snippsat,

I'm a new user and I'm not sure how to reply to you. I tried uninstalling it from the command prompt, it failed to uninstall. I just found out today I have Python 2.7.9 (64-bit) on my system, which I never used. I tried uninstalling that too, but windows says :

/*---------------
There is a problem with this Windows Installer package. A program is required for this install to complete could not be run. Contact your support personnel or package vendor.
*/

So then I tried using python in visual studio 2017: Python 3.6. Can't upgrade or uninstall 'numpy' from there either... Here's the error output:

/*--------------------------------
----- Uninstalling 'numpy' -----
Cannot uninstall 'numpy'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
----- Error while uninstalling 'numpy' -----
'numpy' may not have been uninstalled completely.
----- Installing 'numpy' -----
Collecting numpy==1.16.2
Using cached https://files.pythonhosted.org/packages/ed/29/d97b6252591da5f8add0d25eecda296ea72729a0aad7998edba1981b47c8/numpy-1.16.2-cp36-cp36m-win_amd64.whl
Installing collected packages: numpy
Found existing installation: numpy 1.5.1
Cannot uninstall 'numpy'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
----- Failed to install 'numpy' -----


What should I do?

Thanks.


RE: How to install matplotlib? - snippsat - Mar-15-2019

(Mar-15-2019, 02:03 AM)broccolee Wrote: What should I do?
Follow this and install 3.7 Python 3.6/3.7 and pip installation under Windows
Make sure that Path point to 3.7,see Fixing Path if needed
Then it look like this from cmd.
Microsoft Windows [Version 10.0.17134.648]
(c) 2018 Microsoft Corporation. Med enerett.

C:\WINDOWS\system32>cd\

# Check that point to 3.7
C:\>python -V
Python 3.7.2

# Check pip point to 3.7
C:\>pip -V
pip 19.0.3 from c:\python37\lib\site-packages\pip (python 3.7)

C:\>pip uninstall numpy
Uninstalling numpy-1.16.2:
  Would remove:
    c:\python37\lib\site-packages\numpy-1.16.2.dist-info\*
    c:\python37\lib\site-packages\numpy\*
    c:\python37\scripts\f2py.exe
Proceed (y/n)? y
  Successfully uninstalled numpy-1.16.2

C:\>pip uninstall numpy
Skipping numpy as it is not installed.

# You do this,just showed how uninstall shall work
C:\>pip install matplotlib
Quote:So then I tried using python in visual studio 2017: Python 3.6.
Don't mess with visual studio 2017 use VS Code it's much more geared towards Python.
VS Code from start