Python for Actual Beginners: Installing Python Packages in Windows

We have been learning Python recently. We’ve taken some MOOCs and written some programs that worked, and it all seemed to be going well. Then, I needed to install a package to do something that isn’t included in the regular Python installation.

People on Stack Overflow recommended using another package, easy_install, to make it easier to install other packages. Unfortunately, installing and using easy_install is not so easy. It doesn’t help that the responses to requests for help all assume that you’re either not using Windows at all or have far greater fluency in unix-style shell commands than I have. So, in case we need to install another package someday, or in case some other Windows user stumbles upon this, I decided to post step-by-step instructions.

First, you need to install the installer, either easy_install or pip. I have no idea which is better. They both eventually worked to install a package, which is all I’ve needed from them so far.

1. Download the special Windows version of setuptools or pip here, since the one on the developer’s site won’t work.

2. Run the executable file, making sure the installation is going into your Python folder.

3. Check that easy_install or pip is now in your python/scripts folder

Supposedly, you can add python to your Windows path so it knows how to find your scripts, but that didn’t actually do anything for me, as far as I can tell, so let’s skip it.

Now you can install other packages more easily. I installed Beautiful Soup.

1. Download the file from the developer’s website (did I actually need to do that? I never told easy_install where I downloaded it to…). No, I did not need to do this, that’s what easy_install is for!

2. Open a Windows shell (Windows+R, type cmd, hit enter)

3. Change the directory to your Python scripts folder (if you need to change drives, like I did, just type “d:” to change to drive D, for example, then “cd python\scripts”)

4. Type “easy_install beautifulsoup4” or “pip install beautifulsoup4”

5.  Be thankful that you didn’t have to spend an hour googling error messages to get it to work (or curse me because it still doesn’t work. I probably can’t help if it doesn’t).

Leave a Reply

Your email address will not be published. Required fields are marked *