How do I install an external module from a wheel?

815 views Asked by At

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?

2

There are 2 answers

3
MikeiLL On BEST ANSWER

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.

0
Cfreak On

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

pip.exe install six