Python Forum
matplotlib isn't recognized after installation
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
matplotlib isn't recognized after installation
#1
Hello,

I've installed matplotlib using the following command:
python -m pip install matplotlib

But when I try use it in ma code I get this message:
ModuleNotFoundError: No module named 'matplotlib'

Any comments ?

Thanks.

Reply
#2
How many python installations do you have? Do you use virtual environments? How do you run your code?
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#3
I guess I've one Python installation.
Anyway I can check - does exist any instriuction in Linux to check this ?
I use Jupyter as environment and run my code there.
Reply
#4
if you are on Linux most distros come with python2 and python3 installed. python will run system python2, so I guess you installed matplotib in system python2. Now the question is what version runs in Jupyter

you can run $ which python to see what version invoke python command.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#5
The Jupyter version: 3.6.8

Executing $which python in terminal outputs this: Python 2.7.15+

Resolved.
The instruction sudo apt-get install python3-matplotlib fixed the problem.
Thanks.
Reply
#6
Remember to use pip3 in the future not pip(as it install to Python 2).
Look also at pyenv Simple Python Version Management can make stuff simpler.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  is import cointegration_analysis a recognized module mitcht33 1 384 Nov-06-2023, 09:29 PM
Last Post: deanhystad
  The term 'pip' is not recognized as the name of a cmdlet, function michaelnicol 1 596 Jul-16-2023, 11:12 PM
Last Post: deanhystad
  Index Function not recognized in Python 3 Peter_B_23 1 1,114 Jan-08-2023, 04:52 AM
Last Post: deanhystad
  Matplotlib: How do I convert Dates from Excel to use in Matplotlib JaneTan 1 3,160 Mar-11-2021, 10:52 AM
Last Post: buran
  TypeError: size; expecting a recognized type filling string dict a11_m11 0 2,486 Feb-10-2020, 08:26 AM
Last Post: a11_m11
  how do i get y to be recognized in this comprehension? Skaperen 5 3,068 Aug-26-2019, 07:43 PM
Last Post: Skaperen
  why is my dictionary not recognized as such zatlas1 5 3,683 Jan-14-2019, 01:15 AM
Last Post: woooee
  pyserial-master installed bbut not recognized elwolv1 0 1,964 Jan-04-2019, 08:37 PM
Last Post: elwolv1
  How do I calculate the smallest value that is recognized as a difference when compari AFoeee 1 2,742 Oct-28-2018, 10:48 PM
Last Post: Gribouillis
  'videodigest' is not recognized as an internal or external command MM2018 2 2,728 Oct-12-2018, 02:43 PM
Last Post: MM2018

Forum Jump:

User Panel Messages

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