Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Matplotlib Functions
#1
Hi

I'm running a script in Python3 that is calling for the module matplotlib.pyplot for which I get a message

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

I have installed matplotlib successfully but it doesn't seem to have pyplot with it. Can anybody help please?
Reply
#2
Have you tried thisfrom matplotlib import pyplot?
from matplotlib import pyplot
pyplot.plot ([1, 2, 3, 4])
pyplot.ylabel ('some numbers')
pyplot.show ()

Attached Files

Thumbnail(s)
   
Reply
#3
Hi Bashbedlam

I get the error
+ from matplotlib import pyplot
+ ~~~~
The 'from' keyword is not supported in this version of the language.
Reply
#4
What version of Python are you running?
Have you installed matplotlib?
Reply
#5
I am very confused. Back on March 14 you posted: https://python-forum.io/thread-36650.html which contains code that uses matplotlib.pyplot. There are also references to Python 2.7. Here you reference Python 3. 3.what version is not disclosed.

Are you running Python 2.7 or 3.x? And fi 3.x, what is the x? 6, 8, 10, other? What is your operating system? Are you running straight Python or Anaconda?
Reply
#6
I'm using Python 3.8

The module matplotlib-inline was installed which may have confused things. I have uninstalled this and reinstalled matplotlib.

Is there a command to list the functions of matplotlib to see if pyplot is there? I have tried >>import matplotlib, dir(matplotlib) without sucess.
Reply
#7
When you say "without success", what happens?
What is your development environment? Are you using VSCode, Spyder, IDLE, or what?
Reply


Forum Jump:

User Panel Messages

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