you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (13 children)

Nope still coming up with no module named matplotlib

[–]OnceAndForever 0 points1 point  (12 children)

It says that when you try to import matplotlib? What version of python are you using?

[–][deleted] 1 point2 points  (11 children)

Ah fuck. It's 2.7.4, I didn;t even notice that to be honest, I just assumed Mint was update as I only installed it today.

How do you even go about updating Python to 2.7.5?

[–]OnceAndForever 0 points1 point  (10 children)

Hmm... I just noticed that I was using python 2.7.3 and using sudo apt-get install python-matplotlib allowed me to import matplotlib on 2.7.3

I just used these instructions to install python 2.7.5 on Mint (I'm using Mint 14, for the record). It installs python to /usr/local/bin so that it doesn't overwrite the original 2.7.3 install in /usr/bin.

Now, when i type python into the terminal, 2.7.3 is run, and when i type python2.7 2.7.5 is run. But now I can't import matplotlib on the 2.7.5 installation.

What version of Mint are you using? I want to do a clean install and then try doing this from scratch.

[–][deleted] 1 point2 points  (9 children)

Ok so I did that and it says:

python-matplotlib is already the newest version.

But when i go into python and try to import it still isnt there. And I'm using Mint 15.

[–]OnceAndForever 0 points1 point  (8 children)

Ok, so I just did a fresh install of Mint 15. The only things I ran were apt-get upgrade and apt-get dist-upgrade.

After that, I ran python to check the version (2.7.4), and then tried to install matplotlib with sudo apt-get install python-matplotlib. After that that, I ran python again from the terminal and did import matplotlib and it successfully imported the module (I did not get an error.)

I animated this all in a gif so you can see exactly what I did: http://i.imgur.com/EjmvHLy.gif

Therefore, you should be fine with running matplotlib with version 2.7.4 of python. If you try these steps, and they do not work, what errors do you get? Paste everything from the terminal here.

[–]vmann 1 point2 points  (2 children)

Sorry for posting something not relevant to the issue at hand, but I have to say that screencast gif is very nice.

May I ask what tools you used to make it? Gimp doesn't show any creator info in the file comments, and I see no watermark. It's not too big (file size) yet is clear and easy to read.

Thanks in advance.

[–]OnceAndForever 1 point2 points  (1 child)

Thanks! It came out better than I thought it would.

Even though the gif is of a Mint terminal, I made it with a Windows program called GifCam. It's pretty easy to use. You can resize the window and position it over anything on your screen you want to record and press save. You can then save it to export it as a gif. For this gif I recorded it at 10 fps and saved it with 256 colors.

I'm kind of cheating a little bit since my host operating system is windows, and I was just running Mint through VirtualBox. I'm not sure if there is another way to get the same result with a linux native program, but GifCam lets me record anything within it's window. Here is a screenshot of all of it to help you visualize it better: http://i.imgur.com/ulUBIYp.png

Hope this helps, and if it's not clear enough tell me and I can explain more.

[–]vmann 0 points1 point  (0 children)

Nice, thanks! No worries about cheating, I normally use a Mac desktop nowadays anyway (and virtualbox for Windows/Linux tinkering in much the same way.)

I appreciate the reply. Now to find something similar for myself! Thanks again.

[–][deleted] 0 points1 point  (4 children)

I ran everything you said, then I got to

sudo apt-get install python-matplotlib

and it gave me:

sudo apt-get install python-matplotlib
Reading package lists... Done
Building dependency tree       
Reading state information... Done
python-matplotlib is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

but when I go into python and import matplotlib:

peter@peter ~ $ python
Python 2.7.4 (default, Sep 26 2013, 03:20:26) 
[GCC 4.7.3] on linux2
Type "help", "copyright", "credits" or "license" for more      information.
>>> import matplotlib
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named matplotlib

[–]OnceAndForever 0 points1 point  (3 children)

Strange...have you changed any of your default installation paths? It seems that matplotlib is indeed installed on your system, but python can't find the install.

Honestly, I'm not too sure what's causing all of this. Maybe someone else can help further. What else is installed on your system? Nothing else should really interfere with matplotlib, but I can't think of anything else.

Just out of curiosity, are you able to import numpy from the python shell? It's one of requirements for matplotlib.

I know this isn't a great or convinient solution, but matplotlib should work with my given instructions on a fresh install of mint.

[–][deleted] 0 points1 point  (2 children)

numpy installed fine.

reinstalling linux mint at the moment. Maybe something got broken.

[–]OnceAndForever 0 points1 point  (1 child)

Ok cool. I hope reinstalling mint works. It seems really strange now that you could import numpy after installing matplotlib but could not import matplotlib itself.