text: Q:
  
  Installed Matplotlib using terminal on mac but ModuleNotFoundError in Python
  
  I installed matplotlib using terminal on my mac and it was successfully installed. However, when I try to import matplotlib, it produces the ModuleNotFound error. The following are my codes and error messages.
  Terminal:
  (myProject) bash-3.2$ python3 -m pip install -U matplotlib
  
  Looking in indexes: https://pypi.doubanio.com/simple
  Requirement already up-to-date: matplotlib in /Users/zbao/.local/share/virtualenvs/myProject-opsBTjit/lib/python3.8/site-packages (3.1.3)
  Requirement already satisfied, skipping upgrade: python-dateutil>=2.1 in /Users/zbao/.local/share/virtualenvs/myProject-opsBTjit/lib/python3.8/site-packages (from matplotlib) (2.8.1)
  Requirement already satisfied, skipping upgrade: kiwisolver>=1.0.1 in /Users/zbao/.local/share/virtualenvs/myProject-opsBTjit/lib/python3.8/site-packages (from matplotlib) (1.1.0)
  Requirement already satisfied, skipping upgrade: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /Users/zbao/.local/share/virtualenvs/myProject-opsBTjit/lib/python3.8/site-packages (from matplotlib) (2.4.6)
  Requirement already satisfied, skipping upgrade: cycler>=0.10 in /Users/zbao/.local/share/virtualenvs/myProject-opsBTjit/lib/python3.8/site-packages (from matplotlib) (0.10.0)
  Requirement already satisfied, skipping upgrade: numpy>=1.11 in /Users/zbao/.local/share/virtualenvs/myProject-opsBTjit/lib/python3.8/site-packages (from matplotlib) (1.18.1)
  Requirement already satisfied, skipping upgrade: six>=1.5 in /Users/zbao/.local/share/virtualenvs/myProject-opsBTjit/lib/python3.8/site-packages (from python-dateutil>=2.1->matplotlib) (1.14.0)
  Requirement already satisfied, skipping upgrade: setuptools in /Users/zbao/.local/share/virtualenvs/myProject-opsBTjit/lib/python3.8/site-packages (from kiwisolver>=1.0.1->matplotlib) (45.2.0)
  IDLE:
  import matplotlib
  
  Traceback (most recent call last):
    File "", line 1, in 
      import matplotlib
  ModuleNotFoundError: No module named 'matplotlib'
  Thanks for the help! If anything else is needed please let me know. Sorry I am still very new to Python.
  
  A:
  
  From the look of your traceback, it looks like you have installed matplotlib inside a virtualenv. So your choices are:
  
  run your idle from your virtualenv: myproject/bin/python3 then you should be able to import matplotlib
  run sudo pip install matplotlib. This will install matplotlib into your system Python(2.7) so you can run from your system python. (/usr/bin/python)
  
  Hope this helps
  
  