Tutorial 2 – Setup Python, Pip
Welcome to the 2nd tutorial in Python Behave BDD series.
What you will Learn :
Download and Install Python on Windows OS
What is PIP [Package manager for Python]
Download and Install Python on Windows OS
Go to the website http://python.org/downloads
Click ‘Download Python <version number>’ that you see above
This would download python application exe file for windows
Double click this exe to start installing Python, click ‘Run’ on the popup window that comes up.
In the below window, select both the checkboxes (the second checkbox ensures that Python is added to the environment variable)
Click ‘Install Now’ to install Python in the location mentioned (see above, you can see the location C:\Users …..)
The below window will show the progress of installation
After sometime, the below window would be seen, showing that the python installation was successful
Click Close. This completes Python installation.
Next, how do we know the path where Python got installed on your windows machine?
It got installed at the location seen below (this is one of the screenshots that we saw during Python installation)
So, let us open the windows explorer and cd to this path, see below
Double check that this path is added to system’s environment variables. To do that, right click ‘This PC’
Click Properties
Click ‘Advanced system settings’
Click ‘Environment Variables’
Select Path, as seen below
Click Edit
Click New and add below path
Click OK
Also, go to /Scripts folder as seen below. We need to add this path as well since this path contains ‘pip. Now, pip stands for "preferred installer program" or "Pip Installs Packages". So pip is the standard package manager for python which is used to install/manage additional packages that are not part of standard Python library. When you download any package using pip, the package will automatically be injected into the python environment C:\Users\......\AppData\Local\Programs\Python\Python37-32
So, we don’t have to separately import the packages when we are working on any project. We can directly start working on our project without worrying about importing the additional package
So, copy this path and add this path as well
Click OK and close all windows
To check whether the python has been installed successfully or not, open the command prompt & type python --version and hit enter, you should see the python version that you have installed, see below. This means we have successfully installed Python
Also, the below command will show you the path where python is installed. If you notice, the below shows the same path where the python got installed
The below command will take you to python command prompt
Note:
Please note that, below is the real ‘python’ executable file. That’s the reason we had executed ‘python’ in the above screenshot. If you rename python to something else, lets suppose python3 (in the below directory), than you have to execute python3 in the above command line window. You can try that out
The below command will show you the path where pip is installed
If you notice, the above path matches with the pip path that we saw earlier
Let us cd to this directory
The below command will tell us the packages that are already installed
You can pick up any package from the above list and run the below command ‘pip show <package name’. It will show the details of the package
The below command is also similar to ‘pip list’ that we saw above
These commands come handy as we move ahead. We will continue with our setup in our next tutorial.
Thank you for reading!