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:
Download the official python windows installer from here.
You can download and install the python2.7. Choose the 32 or 64 bit compatibility based on your machine.
Open the downloaded executable and follow all the steps. It installs the python at C:\python27.
Now you have to tell your computer where the python and its packages are located:
- Right click computer and open properties.
- Navigate to advance system settings.
- Select Environmet variables.
- Under User varaibles select path and edit it to include the following:
C:\Python27;C:\Python27\Lib\site-packages\;C:\Python27\Scripts\;
Now that you have setup and configured everything , in order to test it open the command prompt and type "python":
c:\>python
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
!pip install numpy