3

I am attempting to teach myself programming and keep running into problems downloading modules I need for basic tutorials.

My latest attempt has been to get the matplotlib module into my Python 3 environment. I have tried so many different install packages and so many advice I found on the internet that I cannot remember how I originally got the module. But it seemed that everything went well with the installation process.

I am using a Raspberry Pi2 throughout all of this with the Raspbian OS installed.

Python 3.2.3 (default, Mar  1 2013, 11:53:50)
[GCC 4.6.3] on linux2
Type "copyright", "credits" or "license()" for more information.
>>> import matplotlib
Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import matplotlib
ImportError: No module named matplotlib
4
  • How did you installed matplotlib? Commented Dec 9, 2015 at 18:00
  • Maybe you have installed matplotlib for python2. Commented Dec 9, 2015 at 18:02
  • "But it seemed that everything went well with the installation process"--> If you're getting an error, then no, it didn't go well. Try reinstalling and write here how you're installing. Commented Dec 9, 2015 at 18:22
  • where is it I can paste a copy of my terminal window now so that I can show you? What I am attempting to paste goes over the character limit. Commented Dec 10, 2015 at 18:48

1 Answer 1

3

It may be possible that you actually installed the library for python 2. I would use pip to install the modules that you need. If you don't already have it installed, run this first command in the shell:

sudo apt-get install python3-pip

This program can be called with "pip3" or maybe "pip-3.2" in the shell.

To install mathplotlib with it, try running:

pip3 install matplotlib

or

pip-3.2 install matplotlib

That should install the Python 3 module for you.

Sign up to request clarification or add additional context in comments.

6 Comments

the pip-3.2 install was going through the motions and then I received a message- (Currently using distribute 0.6.24dev-r0 (/usr/lib/python3/dist-packages)) Complete output from command python setup.py egg_info: The required version of distribute (>=0.6.28) is not available, install a more recent version first, using 'easy_install -U distribute'. (Currently using distribute 0.6.24dev-r0 (/usr/lib/python3/dist-packages)) ---------------------------------------- Command python setup.py egg_info failed with error code 2 in /home/pi/build/matplotlib
i attempted to copy paste the complete text on my terminal into this box, but was over characters. Should I put this into the "Answer Your Question Box"?
Try running the 'easy_install -U distribute' command and see if that fixes it. Run it as root with sudo or while logged in as root.
im not sure what you mean by rpi@raspberrypi ~ $ sudo easy_install -U distribute sudo: easy_install: command not found pi@raspberrypi ~ $ sudo easy_install -U distribute sudo: easy_install: command not found pi@raspberrypi ~ $ sudo 'easy_install -U distribute' sudo: easy_install -U distribute: command not found pi@raspberrypi ~ $ sudo easy_install-U distribute sudo: easy_install-U: command not found pi@raspberrypi ~ $ sudo easy_install-U distribute sudo: easy_install-U: command not found pi@raspberrypi ~ $ sudo easy_install -u distribute sudo: easy_install: command not found
im not sure what you mean by run it as root. I'm guessing im in the root directory due to the ~ being in the prompt line?
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.