Here we will see how to install embeddable zip Python in Windows Operating System. Generally most of the time we execute msi or executable file to install a product in Windows Operating System. This is just a matter of extracting the downloaded archive or zip file and put anywhere according to your choice and let’s start with programming in Python.
Python 3.7.4, Windows 10 64 Bit
Go through the following steps in order to install embeddable zip Python 3.7.4 in Windows.
- Download the embeddable zip file from the link https://www.python.org/downloads/release/python-374/.
- Extract the archive or zip file into a physical drive location. Let’s say under C drive. So the extracted python root directory is C:\python-3.7.4.
- Add Python root directory to Environment or System Variable.
- Go to search box next to Start menu
envinto the search box
- Now choose either Edit environment variables for your account or Edit system environment variables
- Under User variables, click on New. Add Variable name as PY_HOME and Variable value as C:\python-3.7.4.
- Under User variables, click on Path and click on Edit.
- Now on the popup window, click on New and add %PY_HOME%. Finally click on Ok -> Ok to exit.
Now we will verify our installation of embeddable zip Python using simple hello.py script.
If you do not add the Python root directory into Environment or System Variable, then you will not be able to execute the python script anywhere with the command
python. And for executing your python script you have to give the full path of your Python root directory.
For example, let’s say you have a python script hello.py under C:\python folder.
To execute the above python script without putting python root directory into environment variable you had to execute below command, assuming that you are currently in the C:\python directory in your command prompt:
But with python root directory in environment variable, you have to simply type below command, assuming that you are currently in the C:\python directory in your command prompt :
Though this is a simple example and will not be much difference but when you build a complex application then you will get benefits out of it.
The content of the hello.py is given below:
The above command which we used to execute the hello.py will print
hello in the command window’s console.
Thanks for reading.