Python Forum
Spent over an hour trying to get matplotlib to work
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Spent over an hour trying to get matplotlib to work
#7
(Aug-31-2020, 10:13 AM)snippsat Wrote:
(Aug-31-2020, 09:56 AM)Tomalak Wrote: The only thing I would say is different is I typed Windows key CMD to open the command prompt to install. I don't think I did as you suggest and opened it from the same directory as the exe.
Look this run see that pip -V is showing which version it install to.
Then to test that Matplotlib also work from cmd.
Microsoft Windows [Version 10.0.18362.1016]
(c) 2019 Microsoft Corporation. Med enerett.

C:\Users\Tom>cd\

# Test pip
C:\>pip -V
pip 20.2.2 from c:\python38\lib\site-packages\pip (python 3.8)

# Test python
C:\>python -V
Python 3.8.3

# Install
C:\>pip install matplotlib
Requirement already satisfied: matplotlib in c:\python38\lib\site-packages (3.2.
2)

# Test that it work.
C:\>python
Python 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:37:02) [MSC v.1924 64 bit (AM
D64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib
>>>
>>> matplotlib.__version__
'3.2.2'
>>> exit()

C:\> 
Now that all work here make sure you choose this Python version is use a editor.
It's often called configure a python interpreter in editors.
Quote:I don't think I did as you suggest and opened it from the same directory as the exe
You don't need that,just make sure python and pip command work from anywhere in cmd.
Look at this Python 3.8 (3.6-3.7) and pip installation under Windows

Ok, this is all obvs very helpful. Here is what happened when I typed each line in cmd.

Quote:pip -V
pip 20.2.2 from c:\users\peter\appdata\local\programs\python\python38-32\lib\site-packages\pip (python 3.8)

Quote:pip install matplotlib
Requirement already satisfied: matplotlib in c:\users\peter\appdata\local\programs\python\python38-32\lib\site-packages (3.3.1)
Requirement already satisfied: cycler>=0.10 in c:\users\peter\appdata\local\programs\python\python38-32\lib\site-packages (from matplotlib) (0.10.0)
Requirement already satisfied: python-dateutil>=2.1 in c:\users\peter\appdata\local\programs\python\python38-32\lib\site-packages (from matplotlib) (2.8.1)
Requirement already satisfied: numpy>=1.15 in c:\users\peter\appdata\local\programs\python\python38-32\lib\site-packages (from matplotlib) (1.19.1)
Requirement already satisfied: kiwisolver>=1.0.1 in c:\users\peter\appdata\local\programs\python\python38-32\lib\site-packages (from matplotlib) (1.2.0)
Requirement already satisfied: pillow>=6.2.0 in c:\users\peter\appdata\local\programs\python\python38-32\lib\site-packages (from matplotlib) (7.2.0)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.3 in c:\users\peter\appdata\local\programs\python\python38-32\lib\site-packages (from matplotlib) (2.4.7)
Requirement already satisfied: certifi>=2020.06.20 in c:\users\peter\appdata\local\programs\python\python38-32\lib\site-packages (from matplotlib) (2020.6.20)
Requirement already satisfied: six in c:\users\peter\appdata\local\programs\python\python38-32\lib\site-packages (from cycler>=0.10->matplotlib) (1.15.0)

Quote:python
Python 3.8.5 (tags/v3.8.5:580fbb0, Jul 20 2020, 15:43:08) [MSC v.1926 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.

Quote:>>> import matplotlib
>>>
>>> matplotlib._version_
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'matplotlib' has no attribute '_version_'

So it seems like every line you wanted me to type worked fine apart from the last one?

This is what I get when I try to do a basic thing in matplotlib:
[Image: 3.jpg]
Reply


Messages In This Thread
RE: Spent over an hour trying to get matplotlib to work - by Tomalak - Aug-31-2020, 06:56 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Matplotlib Doesn't Work Ian12290 6 13,360 Feb-28-2017, 06:18 AM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020