Tyler Durden
12-24-2018, 11:16 AM
Hi guys,
Lately I've witnessed quite a few questions from folks regarding running python programs.
I didn't see a guide for the same so I decided to make one myself.
I will be setting up python 2 as well as python 3.
Feedback is appreciated as it helps me improve future guides :)
Here we go :
Download python installers from their official site.
[Only registered and activated users can see links]
Kindly refer to the screenshots for the same.
Kindly note I will be using python 3.6 for this guide as it has tensorflow support.
Select exe or msi installer for x86-64
[Only registered and activated users can see links]
[Only registered and activated users can see links]
[Only registered and activated users can see links]
[Only registered and activated users can see links]
([Only registered and activated users can see links])
Now install the files you downloaded from above, once again refer to the screenshots, the selection must be as shown in the screenshots.
in place of Jack whatever your username on your computer is will be there, Eg: Katie or Mark
[Only registered and activated users can see links]
([Only registered and activated users can see links])
Make sure to click on the disable path length limit option. Select it.
[Only registered and activated users can see links]
[Only registered and activated users can see links]
[Only registered and activated users can see links]
[Only registered and activated users can see links]
([Only registered and activated users can see links])
Now we will be renaming some files to python2 and python3 to be more systematic.
Eg: In python 2.7 installation folder I will rename python.exe to python2.exe
Similarly in python 3 installation folder I will rename python.exe to python3.exe
[Only registered and activated users can see links]
[Only registered and activated users can see links]
[Only registered and activated users can see links]
[Only registered and activated users can see links]
([Only registered and activated users can see links])
Next, we will be adding them to our file path.
Click on the windows button at bottom left of page and type System Environment Variables.
An option should show, click on it.
[Only registered and activated users can see links]
[Only registered and activated users can see links]
[Only registered and activated users can see links]
([Only registered and activated users can see links])
Now click on New and enter the paths, follow the screenshots for guidance. Remember the sequence Red -> Green ->Orange.
New -> Copy Paste the path -> Ok
Refer to the screenshots for the same.
[Only registered and activated users can see links]
Open a new file explorer window and go to the python2 install path.
[Only registered and activated users can see links]
Right click on the file
[Only registered and activated users can see links]
[Only registered and activated users can see links]
Copy the path and paste it after selecting new
[Only registered and activated users can see links]
Repeat for Scripts Folder
[Only registered and activated users can see links]
[Only registered and activated users can see links]
[Only registered and activated users can see links]
[Only registered and activated users can see links]
([Only registered and activated users can see links])
Repeat Step 5 for python3 , just remember it's installed at another place, refer to the below screenshot for the same
[Only registered and activated users can see links]
([Only registered and activated users can see links])
After setting the build paths correctly it should show like this
[Only registered and activated users can see links]
([Only registered and activated users can see links])
Now lets run a program and see. First navigate to the program folder that you want to run. Then Press and hold SHIFT key and right click. It should show the below options. Kindly note powershell is similar to cmd with some extra features, so it's better if you use it.
[Only registered and activated users can see links]
([Only registered and activated users can see links])
Pip is something we will use to install python modules such as Pillow, mechanize, etc. Lets now first make sure PIP is upto date else it will give error saying "Unable to create process using '''' "
Run the following 2 commands
python2 -m pip install --upgrade pip
python3 -m pip install --upgrade pip
Kindly refer to the screenshots for the same.
[Only registered and activated users can see links]
[Only registered and activated users can see links]
pip2 is for python2 and pip3 for python3 . To install a module simply run pip2 install "modulenameherewithoutquotes" or pip3 install "modulenameherewithoutquotes".
Here is an example:
[Only registered and activated users can see links]
([Only registered and activated users can see links])
Now lets finally run the program.
Remember to run a python 2 program type
python2 "filenamewithoutquotes".py
and for python3
python3 "filenamewithoutquotes".py
Make sure you are in the same directory as the file you are running.
To go to a particular directory type
cd "directorypathherewithoutquotes"
Eg: cd C:/Python
Here is an example of me running DailyDoer while being in the same directory
python2 DailyDoer.py
[Only registered and activated users can see links]
([Only registered and activated users can see links])
That's it folks. That's how to install python and run python programs.
If you have any suggestions or need help, feel free to reach out to me, I'm happy to help and constructive feedback is welcome :)
Update: Added commands and more explanation for easier understanding.
Lately I've witnessed quite a few questions from folks regarding running python programs.
I didn't see a guide for the same so I decided to make one myself.
I will be setting up python 2 as well as python 3.
Feedback is appreciated as it helps me improve future guides :)
Here we go :
Download python installers from their official site.
[Only registered and activated users can see links]
Kindly refer to the screenshots for the same.
Kindly note I will be using python 3.6 for this guide as it has tensorflow support.
Select exe or msi installer for x86-64
[Only registered and activated users can see links]
[Only registered and activated users can see links]
[Only registered and activated users can see links]
[Only registered and activated users can see links]
([Only registered and activated users can see links])
Now install the files you downloaded from above, once again refer to the screenshots, the selection must be as shown in the screenshots.
in place of Jack whatever your username on your computer is will be there, Eg: Katie or Mark
[Only registered and activated users can see links]
([Only registered and activated users can see links])
Make sure to click on the disable path length limit option. Select it.
[Only registered and activated users can see links]
[Only registered and activated users can see links]
[Only registered and activated users can see links]
[Only registered and activated users can see links]
([Only registered and activated users can see links])
Now we will be renaming some files to python2 and python3 to be more systematic.
Eg: In python 2.7 installation folder I will rename python.exe to python2.exe
Similarly in python 3 installation folder I will rename python.exe to python3.exe
[Only registered and activated users can see links]
[Only registered and activated users can see links]
[Only registered and activated users can see links]
[Only registered and activated users can see links]
([Only registered and activated users can see links])
Next, we will be adding them to our file path.
Click on the windows button at bottom left of page and type System Environment Variables.
An option should show, click on it.
[Only registered and activated users can see links]
[Only registered and activated users can see links]
[Only registered and activated users can see links]
([Only registered and activated users can see links])
Now click on New and enter the paths, follow the screenshots for guidance. Remember the sequence Red -> Green ->Orange.
New -> Copy Paste the path -> Ok
Refer to the screenshots for the same.
[Only registered and activated users can see links]
Open a new file explorer window and go to the python2 install path.
[Only registered and activated users can see links]
Right click on the file
[Only registered and activated users can see links]
[Only registered and activated users can see links]
Copy the path and paste it after selecting new
[Only registered and activated users can see links]
Repeat for Scripts Folder
[Only registered and activated users can see links]
[Only registered and activated users can see links]
[Only registered and activated users can see links]
[Only registered and activated users can see links]
([Only registered and activated users can see links])
Repeat Step 5 for python3 , just remember it's installed at another place, refer to the below screenshot for the same
[Only registered and activated users can see links]
([Only registered and activated users can see links])
After setting the build paths correctly it should show like this
[Only registered and activated users can see links]
([Only registered and activated users can see links])
Now lets run a program and see. First navigate to the program folder that you want to run. Then Press and hold SHIFT key and right click. It should show the below options. Kindly note powershell is similar to cmd with some extra features, so it's better if you use it.
[Only registered and activated users can see links]
([Only registered and activated users can see links])
Pip is something we will use to install python modules such as Pillow, mechanize, etc. Lets now first make sure PIP is upto date else it will give error saying "Unable to create process using '''' "
Run the following 2 commands
python2 -m pip install --upgrade pip
python3 -m pip install --upgrade pip
Kindly refer to the screenshots for the same.
[Only registered and activated users can see links]
[Only registered and activated users can see links]
pip2 is for python2 and pip3 for python3 . To install a module simply run pip2 install "modulenameherewithoutquotes" or pip3 install "modulenameherewithoutquotes".
Here is an example:
[Only registered and activated users can see links]
([Only registered and activated users can see links])
Now lets finally run the program.
Remember to run a python 2 program type
python2 "filenamewithoutquotes".py
and for python3
python3 "filenamewithoutquotes".py
Make sure you are in the same directory as the file you are running.
To go to a particular directory type
cd "directorypathherewithoutquotes"
Eg: cd C:/Python
Here is an example of me running DailyDoer while being in the same directory
python2 DailyDoer.py
[Only registered and activated users can see links]
([Only registered and activated users can see links])
That's it folks. That's how to install python and run python programs.
If you have any suggestions or need help, feel free to reach out to me, I'm happy to help and constructive feedback is welcome :)
Update: Added commands and more explanation for easier understanding.