Python Tutorial - Installation
The first step to learn any programming language is actually not
Hello World, but the installation of the language package.
Python 3 Installation
Python 3 on Windows
Firstly, go to Python official website download page https://www.python.org/downloads/ to download the latest version of Windows - Python 3.6.4 as it is in January 2018.
The installation directory of Python is by default embedded with the Python version number, e.g. The latest version Python 3.6.4 will be installed at
C:\Python36\. You could install multiple Python versions installed on your PC without any conflicts. But it also means that you need to specify the Python version number every time you start python if you have multiple Python versions. For example, put
C:\Python36\ to the system
PATH variables. Or for simplicity, you could use the bash script below to modify
PATH=C:\Ptyon36should be ahead of
%PATH%, otherwise, the system will call the Python in the existing system
PATHhas already contained other Python version’s full path.
Python 2 on Windows
The installation process is similar to the above process with the difference that you should download latest Python 2 version, that is, Python 2.7.14 as it is in January 2018.
Virtual Environment Installation
A virtual environment is a Python environment in which you can install separate interpreter, libraries, and scripts. So this virtual environment is isolated from other virtual environments and any change (installation and deletion) will not affect this virtual environment.
Python virtual environment can be created by using the following tools:
venvwhich is present by default when you install Python version 3.3 and later and it installs
setuptoolsin virtual environment in Python version 3.4 and later.
virtualenvis also a tool to create Python virtual environment. Python version 2.6+ and 3.3+ are supported by
virtualenv. When you are using
virtualenvfor creating virtual environment,
wheelswill be installed by default in our virtual environment.
In this section,
virtualenv will be used to create an isolated Python virtual environment and then packages will be installed into the corresponding virtual environment:
Below are the steps you should follow,
distribute download address:
pip download link: https://bootstrap.pypa.io/get-pip.py
Run command prompt as administrator and navigate to the folder where you have downloaded
Now run the following commands for the installation of
C:\> cd Users\HP\AppData\Local\Programs\Python\Python36-32 C:\Users\HP\AppData\Local\Programs\Python\Python36-32> Python distribute_setup.py C:\Users\HP\AppData\Local\Programs\Python\Python36-32> Python get-pip.py
pip install virtualenv