ModuleNotFoundError: No module named 'matplotlib'

I am trying to run a python program that requires matplotlib, which I already installed via pip. I am running Python 3.6 locally on my Mac, updating my .bash_profile to reflect this. The corresponding import line is as follows:

import matplotlib.pyplot as plt

The following is the error message that can be seen from the subject line:

ModuleNotFoundError: No module named 'matplotlib'

And here is what I see if I try pip install matplotlib:

Requirement already satisfied: matplotlib in /usr/local/lib/python3.6/site-packages
Requirement already satisfied: python-dateutil in /usr/local/lib/python3.6/site-packages (from matplotlib)
Requirement already satisfied: numpy>=1.7.1 in /usr/local/lib/python3.6/site-packages (from matplotlib)
Requirement already satisfied: pyparsing!=2.0.0,!=2.0.4,!=2.1.2,!=2.1.6,>=1.5.6 in /usr/local/lib/python3.6/site-packages (from matplotlib)
Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.6/site-packages (from matplotlib)
Requirement already satisfied: pytz in /usr/local/lib/python3.6/site-packages (from matplotlib)
Requirement already satisfied: six>=1.10 in /usr/local/lib/python3.6/site-packages (from matplotlib)

I referenced several other posts such as this and, but without much luck. I don’t notice an answer that I just could not handle, or maybe something else? Your time is appreciated.

+4
source share
2 answers

pip3 install matplotlib matlplot lib. , pip 2.7, . pip3 python 3, , python 3

+3

, : -

import pip
pip.main(["install","matplotlib"])
0

Source: https://habr.com/ru/post/1694667/


All Articles