Pages

Install Python Packages on Windows 7

  1. Open the Command Prompt
  2. Go to your Start Menu. Start > All Programs > Accessories > Command Prompt
  3. Type into the Command Prompt window:
set path=%path%;C:\Python27\
  1. And hit enter.
You only need to do this once and never again. Read about it here:http://docs.python.org/tutorial/interpreter.html
  1. Download simplejson at http://pypi.python.org/pypi/simplejson
  2. This is a simplejson-2.1.6.tar.gz file, which in Windows language means it is a strange and otherworldly kind of zip file.
  3. To open the *tar.gz file, download PeaZip for Windows http://peazip.org/
  4. Use PeaZip to extract (uncompress / unzip) simplejson-2.1.6.tar.gz into your Download directory.
  5. You should end up with something similar to this:C:\Users\pdxNat\Downloads\simplejson-2.1.6\
  6. Go back to your Command Prompt window or open a new one.
  7. 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 )
  8. When you start, your command line should look something like this:
c:\Users\pdxNat>
  1. You want to get into the simplejson-2.1.6 directory, 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

  1. Your prompt will change from this
  2. c:\Users\pdxNat>
  3. to this
  4. c:\Users\pdxNat\Downloads\simplejson-2.1.6>
  5. Now for the fun part. 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 :
  6. For Windows 7 64 bit users, type: setup.py install. For other windows users type: python setup.py install
  7. See all that stuff flying by? 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\
  8. You'll see simplejson-2.1.6-py2.7.egg has been added to the directory.
  9. Now open IDLE (Start > All Programs > Python 2.7 > IDLE (Python GUI)) and type the following:
  10. >>> import simplejson
  11. See all that nothing that happens? That's your sign of success. Congratulations.
  12. You've just installed and imported your first package for Python on Windows 7.
  13. Repeat as needed.
  14. For more information
  15. http://docs.python.org/tutorial/index.html
  16. http://www.python-forum.org
  17. -Download a package
  18. -Extract the package
  19. -Open Command Prompt
  20. -set path (1st time only)
  21. -change directory to Download\package\
  22. -type >python setup.py install
  23. -smile

No comments:

Post a Comment