python setup and package installation

Posted on August 15, 2016 in misc

Python : Setup and Installation

Its a good news for mac book and linux users: In either case python is comes out of the box and you need not install it. But in case of windows please follow the below setup instructions:

  1. Download the official python windows installer from here.

  2. You can download and install the python2.7. Choose the 32 or 64 bit compatibility based on your machine.

  3. Open the downloaded executable and follow all the steps. It installs the python at C:\python27.

  4. Now you have to tell your computer where the python and its packages are located:

    1. Right click computer and open properties.
    2. Navigate to advance system settings.
    3. Select Environmet variables.
    4. Under User varaibles select path and edit it to include the following:
       C:\Python27;C:\Python27\Lib\site-packages\;C:\Python27\Scripts\;
  5. Now that you have setup and configured everything , in order to test it open the command prompt and type "python":

    c:\>python
  6. If its showing a interpreter, your installation is a success:

     '>>>'

Installing Packages for python: pip

Python installation does'nt come with all the packages . It only has limited and significant ones. Packages are a set of modules that are written to implement a task or satisfy a functionality. These packages can be downloaded and installed into python. Python comes with "pip" utility which makes life easy. This command downloads the desirsed python package and installs if for you. Execute this command at the command line.

      pip install 

Example: If you want to install tweepy a package that helps dealing with twitter API:

     pip install tweepy
In [1]:
!pip install numpy
Requirement already satisfied (use --upgrade to upgrade): numpy in /Users/chandanuppuluri/classwork/Sentimental/env/lib/python2.7/site-packages

In [ ]: