-1

I have been trying to plot simple graphs in python 2.7 using matplotlib. I am using ubuntu and I have installed all the dependencies and matplotlib. Still when I try to run the code for plotting graphs, it gives me an error in terminal saying

enter image description here

I am new to python. What does this mean? and how do I resolve this?

user40330
  • 111
  • 1
  • 6
  • 2
    have you read [this](http://stackoverflow.com/questions/26289473/pycharm-error-while-importing-matplotlib-pyplot-as-plt)? Does it help? I know you are not on Windows, but read the comments as well – Pynchia Jun 17 '15 at 22:19
  • 1
    or [this](http://stackoverflow.com/questions/13292396/error-importing-matplotlib-pyplot) – Pynchia Jun 17 '15 at 22:21
  • 1
    or [this](http://stackoverflow.com/questions/5655314/problem-importing-pylab-in-python-2-6) - it's the same error message (different py vers., though). – Ami Tavory Jun 17 '15 at 22:21
  • Would you please edit your error and copy the message over rather than using a screen shot. – Richard Erickson Jun 17 '15 at 23:41
  • Could you please accept my answer if my approach helps you solve the problem? Many thanks – Jianxun Li Jun 27 '15 at 07:31

1 Answers1

1

I also use Ubuntu 14.04. It seems that the dependency has been messed up. The most easiest way is to install Anaconda as it handles all these sorts of issues quite well and very easy to install.

Here is the link for download Anaconda.

http://continuum.io/downloads

You could choose either python 2.7 or 3.4. (I personally prefer 3.4)

Just download that installer. I assume it's in /home/your_user_name/Downloads folder. Just open an terminal, type

$cd /home/your_user_name/Downloads
$ls

make sure you see your downloaded installer in this folder. Then

bash Anaconda-2.2.0-Linux-x86_64.sh

this could be different if you are using 32-bit Ubuntu OS.

After the installation, it asks you whether add the PATH to environment. Choose yes. Finally, open a terminal again

$conda update conda
$conda update anaconda

Now you are ready to go.

Jianxun Li
  • 24,004
  • 10
  • 58
  • 76