Installing Python Libraries in Windows 10

First and foremost, as somebody that often just wants to get what I am looking for, I appreciate the fact that you may not want to read of the introduction.  If that is the case, just jump straight to the meat and potatoes below.  For the rest of you, I will keep it short and sweet.

I recently decided to take a computer science course.  For the last few years I have been finding that much of our work ends at the point in which a client needs a complicated technology solution.  We have had some successes in designing applications and having them built, however one thing that we have learned is that we have  a great deal to learn.  The world of software engineering is nebulous.  What seems eloquent and simple on the outside can be incredibly complicated and hectic within.

I have always been a PC person.  I think this is due to the fact that much of the business world runs on them.  I fell into it by default.  Programmers live on several different planets.  Planet Mac is for those that are looking for a sleek well designed machine that will match their sofa.  Linux is an entire galaxy of operating systems ranging with users that may simply want a bit more control over their command prompt to others that may be up to nefarious activities such as hacking the DNC or blackmailing Kevin Spacey.

I live on planet PC.  If you’re just looking for a nice suite of business intelligence software it’s great.  If you’re trying to learn web development it is somewhere between atrocious and catastrophic.  Its a world of ridicule.  Nobody on this planet seems to know how anything works.  You can call somebody from one of the other planets for help, but you’re likely to be met with ridicule.  “Windows is stupid.”  “Maybe you should get a real operating system.”

Everybody has their own complicated work around for tasks that on the surface feel like they should be simple.  Case in point:  go look for some information about how to install Passlib and Bcrypt on windows.  The best tutorials assume a certain amount of knowledge about the command prompt, an esoteric black hole.  The worst are marred with comments sections full of frustrated users.  I thought I would simply share how I got this library installed.  Hopefully it will save somebody an hour of their life in the future.

The Meat and Potatoes

  1. Change your environment settings

    1. Open the Control Panel
      1. You can do this by typing “Control Panel” in the Windows search bar (lower left corner of your screen)control panel
    2. Navigate to System and Securitysystem and security
    3. Navigate to Systemsystem
    4. Navigate to Advanced system settings to open the System Properties boxsystem nav
    5. Navigate to the Advanced tab and click Environment Variablessystem properties
    6. Under System Variables highlight the Path variable and click Editsystem variables
    7. In the Edit environment variable popup, click New and then enter the path to the python folder on your computer.  This could end up in a number of places, I had to search for python in Windows explorer in order to find it.  My path was: c:\Users\Chris\AppData\Local\Programs\Python\Python36-32edit variables
    8. Add another path to the scripts folder within your python folder.  this should be the same path with \scripts at the end of it.  Mine was: c:\Users\Chris\AppData\Local\Programs\Python\Python36-32\scripts
  2. Install pip for Python

    1. Navigate to here to the pip download page
    2. Navigate to the Installation pagepip installation
    3. Download the get-pip.py package (You have to right click and click “Save link as”)get pip
      1. Simply click on the downloaded package in your browser to run itpip download.PNG
  3. Download and install the pip source package

    1. It can be found here.  source.PNG
    2. Use Git Bash to unzip the package.  There are other ways of unzipping tar files, I just found this easiest based on the fact that I already had Git Bash.  You can download it here
      1. Navigate to where you downloaded package ( ex: cd ./downloads) to and type tar –xvzf passlib-1.7.1.tar.gz
    3. Install the package with Windows Command Prompt
      1. You can do this by typing command in the windows search bar
      2. Navigate to where you unzipped the package (ex: cd ./downloads/passlib-1.7.1)
      3. Type python setup.py install
      4. Close command prompt
  4. Install the Bcrypt library

    1. Reopen Command Pompt as an administrator
      1. Type command in the windows search bar
      2. right click Command Prompt
      3. Choose Run as administrator
    2. In the Command Prompt, type pip install passlib[bcrypt]

That was easy right?  Hopefully this saves a novice programmer some of the headache that I went through yesterday.

Installing Python Libraries in Windows 10