Brandon
Brandon

Reputation: 89

Error importing matplotlib except when using anaconda

I've been trying to run a program on my computer that uses matplotlib, but whenever I run it, I get the following error:

ImportError: No module named 'matplotlib'

So far, I have tried installing it via:

pip install matplotlib
pip3 install matplotlib
python3 -m pip install matplotlib
sudo apt-get install python3-matplotlib

The only way it manages to work is if I install it through anaconda, but after I uninstall it, it starts showing the error message again. I am using Ubuntu, and I have edited my .bashrc file to contain these lines:

export PYTHON=python3
alias python=python3

What could be the reason that anaconda is the only solution? And why doesn't it continue to work after it's uninstalled?

Upvotes: 0

Views: 61

Answers (1)

asdf
asdf

Reputation: 460

Could you try the following:

From terminal run:

python3 -m pip install matplotlib

If that doesn't work try from terminal:

easy_install matplotlib

If that also doesn't work, then try opening the python interpreter (python3 in terminal) and run the following in the python interpreter:

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

Upvotes: 1

Related Questions