How to Install Python Packages on Windows

Open the Command Prompt. , Go to your Start Menu., Type into the Command Prompt window: set path=%path%;C:\Python27\ , And hit enter., Download simplejson at http://pypi.python.org/pypi/simplejson. , This is a simplejson-2.1.6.tar.gz file, which in...

60 Steps 1 min read Advanced

Step-by-Step Guide

  1. Step 1: Open the Command Prompt.

    Start > All Programs > Accessories > Command Prompt. ,, You only need to do this once and never again.

    Read about it here: http://docs.python.org/tutorial/interpreter.html ,,,,,,,,,,,,,, Inside that simplejson directory there is a file called setup.py.

    We're going to install that into the Python universe.

    Type this into the Command Prompt : , For other windows users type: python setup.py install , Forget about it.

    Open a Windows Explorer window (Start > All Programs > Accessories > Windows Explorer ) and go have a look inside the directory at C:\Python27\Lib\site-packages\ ,,,, That's your sign of success.

    Congratulations. ,,,,,,,,,,,, For example, C:\Python33\ if you want to use the command line.,,,,,,,,, C:\Python33\) preceded by a semicolon (;) which is used to separate the values, so you would add
    - ;C:\Python33\.,,,
  2. Step 2: Go to your Start Menu.

  3. Step 3: Type into the Command Prompt window: set path=%path%;C:\Python27\

  4. Step 4: And hit enter.

  5. Step 5: Download simplejson at http://pypi.python.org/pypi/simplejson.

  6. Step 6: This is a simplejson-2.1.6.tar.gz file

  7. Step 7: which in Windows language means it is a strange and otherworldly kind of zip file.

  8. Step 8: To open the *tar.gz file

  9. Step 9: download PeaZip for Windows http://peazip.org/

  10. Step 10: Use PeaZip to extract (uncompress / unzip) simplejson-2.1.6.tar.gz into your Download directory.

  11. Step 11: You should end up with something similar to this: C:\Users\pdxNat\Downloads\simplejson-2.1.6\

  12. Step 12: Go back to your Command Prompt window or open a new one.

  13. Step 13: You'll need to change directories in the command line and here's how you do that (http://coweb.cc.gatech.edu/ice-gt/339 )

  14. Step 14: When you start

  15. Step 15: your command line should look something like this: c:\Users\pdxNat>

  16. Step 16: You want to get into the simplejson-2.1.6 directory

  17. Step 17: so at the command prompt type this: cd downloads\simplejson-2.1.6 or the complete path: cd c:\Users\pdxNat\Downloads\simplejson-2.1.6

  18. Step 18: Your prompt will change from this

  19. Step 19: c:\Users\pdxNat>

  20. Step 20: to this

  21. Step 21: c:\Users\pdxNat\Downloads\simplejson-2.1.6>

  22. Step 22: Now for the fun part.

  23. Step 23: For Windows 7 64 bit users

  24. Step 24: type: setup.py install.

  25. Step 25: See all that stuff flying by?

  26. Step 26: You'll see simplejson-2.1.6-py2.7.egg has been added to the directory.

  27. Step 27: Now open IDLE (Start > All Programs > Python 2.7 > IDLE (Python GUI)) and type the following:

  28. Step 28: >>> import simplejson

  29. Step 29: See all that nothing that happens?

  30. Step 30: You've just installed and imported your first package for Python on Windows 7.

  31. Step 31: Repeat as needed.

  32. Step 32: For more information

  33. Step 33: see http://docs.python.org/tutorial/index.html and http://www.python-forum.org.

  34. Step 34: Download a package.

  35. Step 35: Extract the package

  36. Step 36: Open Command Prompt

  37. Step 37: Set path (1st time only)

  38. Step 38: Change directory to Download\package\

  39. Step 39: Type >python setup.py install.

  40. Step 40: Download the Windows MSI installer (either x86 or x64).

  41. Step 41: Run the program.

  42. Step 42: Take note of the path during the installation.

  43. Step 43: If you do not care to use the command line

  44. Step 44: you can now use the IDLE integrated development environment for Python and consider yourself done.

  45. Step 45: If you want to use the command line

  46. Step 46: click on Control Panel.

  47. Step 47: Click on System and Security.

  48. Step 48: Click on System.

  49. Step 49: Click on the Advanced system settings link.

  50. Step 50: Click on the Environmental Variables button.

  51. Step 51: Under System Variables

  52. Step 52: look for the Variable named Path.

  53. Step 53: Select Path and click on the Edit button.

  54. Step 54: At the end of the Variable value

  55. Step 55: add the value you took note of in step 3 (i.e.

  56. Step 56: Open your command line and type 'python' - if successful

  57. Step 57: you should see three greater than symbols at the command prompt (>>>).

  58. Step 58: To exit the Python interpreter

  59. Step 59: type 'exit()'.

  60. Step 60: That's it!

Detailed Guide

Start > All Programs > Accessories > Command Prompt. ,, You only need to do this once and never again.

Read about it here: http://docs.python.org/tutorial/interpreter.html ,,,,,,,,,,,,,, Inside that simplejson directory there is a file called setup.py.

We're going to install that into the Python universe.

Type this into the Command Prompt : , For other windows users type: python setup.py install , Forget about it.

Open a Windows Explorer window (Start > All Programs > Accessories > Windows Explorer ) and go have a look inside the directory at C:\Python27\Lib\site-packages\ ,,,, That's your sign of success.

Congratulations. ,,,,,,,,,,,, For example, C:\Python33\ if you want to use the command line.,,,,,,,,, C:\Python33\) preceded by a semicolon (;) which is used to separate the values, so you would add
- ;C:\Python33\.,,,

About the Author

S

Sandra Smith

Committed to making DIY projects accessible and understandable for everyone.

72 articles
View all articles

Rate This Guide

--
Loading...
5
0
4
0
3
0
2
0
1
0

How helpful was this guide? Click to rate: