Python 3 installation guide

keskiviikko 10. lokakuuta 2018

1. Navigate to: https://www.python.org/downloads/ and download the newest version of Python 3.7.0. for your operating system. This guide uses Windows 10.
2. Start installation by clicking the python-3.7.0.exe

Here you can add Python to your Windows Environment variable PATH by clicking the lower option "Add Python 3.7 to PATH". Click "Customize installation".

 Next!
 Default installation folder is C:\Python3. Click Install!

And after a short wait, Python 3.7.0. has been installed succesfully.

4.  And we can verify the succesfull installation by searching for "cmd" and opening the "Command Prompt" by hitting Enter.


Now we can write a commad to the command prompt: python --version 
and python gracefully answers with version 3.7.0. 


If the command produces an error, it means that the Python installation path has not been added to the Windows PATH environment variable and that's why the command prompt can't find it.

But we can fix this by simply adding it to the PATH!


5. Setting Windows 10 Environment variables

The most important environment variable is PATH, which the command prompt uses to find paths to installed programs. Python has its own internal path variable named PYTHONPATH, that is used as the default directory for findgin Python libraries and modules.

Open the Environment variables by writing "environment variables" to search and press Enter.


 Click on Environment Variables.

 Choose the PATH variable and doubleclick it.

Click NEW button and add two new lines:
C:\Python3
C:\Python3\Scripts

Click OK and confirm changes. Now, when you open the command prompt (Step 4) and try the command again, it should print the correct version number.

(Extra tip for maintaining both Python 2.7 and Python 3.7 installations)

6. If you have both Python 2.7 and Python 3.7 installed and you want to use both of them through the command prompt, rename one the python.exe files. In the example picture below, I renamed my Python 3 installation's .exe file to "python3.exe". Now I can write "python3 --version", when I want to use Python 3 and write "python --version", when I want to use the old Python 2.7.




  Last updated 10.10.2018

Ei kommentteja:

Lähetä kommentti