0

I'm trying to run someone else's script in Python 2.7 on Win7x64 (but 32-bit Python - I need it to be 2.7 to run pyserial, apparently). It starts with the following lines:

import os
import matplotlib.pyplot as plt
import numpy as np
from pylab import *
from mpl_toolkits.mplot3d import Axes3D

Which gives the error:

Traceback (most recent call last):
  File "C:\xxxxxx\Muddy Data Plot.py", line 9, in <module>
    import matplotlib.pyplot as plt
  File "C:\Python27\lib\site-packages\matplotlib\__init__.py", line 105, in <module>
    import six
ImportError: No module named six

I cannot figure out what is wrong, or how to fix it. The only thing I can find about six gives me something called a "wheel," which I can only install with something called pip, but I can't figure out how to use any of those things. I think I got pip installed, but I can't figure out how to use it, or what the commands are.

Am I supposed to use the Windows command prompt with pip? Or the Python shell? Do I need to import it first? I've added the python and scripts folder (which does contain something called pip.exe) to the Windows environment variables, to no effect. Am I supposed to put the wheel file somewhere in particular? I've rebooted about three times to make sure all the various changes took.

Can someone provide an explanation that doesn't assume a thorough knowledge of Python?

TigerhawkT3
  • 44,764
  • 6
  • 48
  • 82
MCA
  • 5
  • 4

2 Answers2

1

In the windows shell (make sure pip.exe is in your path)

pip.exe install six
Cfreak
  • 18,362
  • 6
  • 44
  • 56
0

To install pip on windows, follow this answer.

And then you run pip from the command prompt like pip install six, or maybe pip.exe install six as other answer states.

You can also just type pip (pip.exe?)into the command prompt terminal to get some helpful pip info.

Community
  • 1
  • 1
MikeiLL
  • 5,393
  • 3
  • 30
  • 56
  • So, apparently that installed six, and gave me a new error, this time "ImportError: matplotlib requires dateutil", but pip install dateutil" doesn't work Also, none of the commands cause any output. I type, and it just pauses and shows another command line. – MCA Jun 12 '15 at 02:08
  • 1
    Ok, I took a shot in the dark and typed "pip install matplotlib", in spite of having run the installer executable previously. For no good reason, this time it worked. – MCA Jun 12 '15 at 02:16
  • Fun stuff. : ) I started learning python about a year ago. Mountains left to traverse. – MikeiLL Jun 12 '15 at 02:34