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
  TypeError: size; expecting a recognized type filling string dict a11_m11 0 515 Feb-10-2020, 08:26 AM
Last Post: a11_m11
  how do i get y to be recognized in this comprehension? Skaperen 5 585 Aug-26-2019, 07:43 PM
Last Post: Skaperen
  why is my dictionary not recognized as such zatlas1 5 816 Jan-14-2019, 01:15 AM
Last Post: woooee
  pyserial-master installed bbut not recognized elwolv1 0 649 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 1,070 Oct-28-2018, 10:48 PM
Last Post: Gribouillis
  'videodigest' is not recognized as an internal or external command MM2018 2 952 Oct-12-2018, 02:43 PM
Last Post: MM2018
  Class attribute not recognized\working J125 1 2,344 Dec-19-2016, 01:05 AM
Last Post: Yoriz
  Dictionary value not recognized marciokoko 1 1,934 Nov-16-2016, 04:01 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

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