Its been so long since I’ve put a post up on here! Between a busy period at work and a month of creative block I’ve had nothing to show.
I was exposed to more python recently, so decided to have a go at some more script work. There were a number of external modules I wanted to install on my home pc, but I was quite confused with their file types and installation. So, for anyone else that feels that way (and is a windows user)- here’s how I did it!
Python Module File Types
You’ll find python modules available to download in at least 3 file types:
- .exe – the easiest installation method, just run the executable
- .egg – a binary package that can be installed though python’s easy install command in a windows command line
- .wheel – a binary package that can be installed though python’s pip command in a windows command line
I’ll be using a .wheel package, but I imagine installing an .egg file will be a very similar process.
To check if you have pip, navigate to your python folder and check if there is a pip folder in site-packages. Your pip path will likely be something like this:
If you don’t have pip, install it according to this guide. They can explain better than I could!
However, if you don’t have pip it may be worth upgrading to a python version after 2.6 as it comes prepackaged.
Install Your Module
For this tutorial, I’ll be installing pySide, a GUI module, but this works for any .wheel file. Pip is going to automatically download the file for us, and then install it.
We’re going to install the file via the command line. Navigate to your equivalent of:
You should see pip.exe in the folder. In the address bar, write cmd and press enter. This launches the command line from this path, so we don’t have to tell the command line where pip.exe is located.
In the command line, type:
pip install myModule
Replace myModule with the name of the module you wish to install. You do not need the .wheel filename.
That’s your module installed! You can check that it worked by going into a Python shell or IDE and typing:
If there’s no errors, you’re good to go!