Axzd
Axzd

Reputation: 55

import matplotlib.pyplot as plt despite matplotlib installed and working

I have read several of the issues related to the same problems but didn't find a solution. I am working on Ubuntu 20.04.

I installed matplotlib in a conda environment called math.

conda install matplotlib

(conda 4.10.3)

No error, it went well it seems. But then, when I launch a jupyter notebook and tries

import matplotlib.pyplot as plt

I get

ModuleNotFoundError: No module named 'matplotlib.pyplot'

However, running

import matplotlib as plt

works without problem.

I launch the notebook from the conda math environment.

Any idea?

Thanks a lot

Upvotes: 0

Views: 954

Answers (2)

Axzd
Axzd

Reputation: 55

Actually I solved the problem by reinstalling Jupyter noteboook.

Upvotes: 0

Pranav Agrawal
Pranav Agrawal

Reputation: 11

  1. Run Command Prompt as admin.
  2. Run pip install matplotlib
  3. The problem may be resolved. Moreover check if you are running the latest version of Python.
  4. If pip is not found. Reinstall Python. While reinstalling, remember to select "Add Python to path".

Hope it helps..

Upvotes: 1

Related Questions