Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to make Python 3 as your default Python Version on Windows 10/7

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 62
    Comment on it

    Python is known to be a Data Science programming language that effectively and simply solves algorithmic problems or Python is used to develop web applications. Python is a universal programming language. Python eases the execution of code because of its built-in library functions in object-oriented programming. Python has a large collection of library and it keeps on upgrading. Due to this, there are many versions of Python and Pythonists sometimes find it difficult to make a particular Python version default. Through this write-up, let us understand how we can make Python 3 version default in Windows operating system.

    Step 1: Getting started from command-line

    To check the Python version installed in your computer, you need to execute the following command command-line prompt:

    py

    You will be able to check the latest version of Python you have installed:

    py -3

    Step 2: Downloading relevant Python version

    If in case, Python 3 is not installed in your system, try installing it from Python.org or follow this link https://www.python.org/downloads/windows/

    Scroll down and download the executable file of the size of your windows (32-bit or 64-bit).

    You only need to double click on the executable file and install it.

    Step 3: Adding Python3 to the windows environment variable path

    Now, when you have completed the installation of Python 3 in your system, let us see how we can add Python 3 version to the path. The default path will be:

    C:\Users\This PC\AppData\Local\Programs\Python

    Now, the above path is not convenient as AppData is a hidden folder that may cause problems with a few of the Python modules such as Jupyter. Therefore, move it to C drive (C:/)

    https://i0.wp.com/feaforall.com/wp-content/uploads/2019/12/image-1.png?ssl=1

    Now, change the name of its executable to python3.exe.

    https://i1.wp.com/feaforall.com/wp-content/uploads/2019/12/image-2.png?ssl=1

    Done? Now, Locate Environment Variables in your system. This will be done by right-clicking on the “This PC” option in your computer and click on the Properties option. After doing this, click on Advanced System Settings under the Properties option.

    Once you have done this, a pop-up will appear on the screen that will be displaying various options out of which you have to click on Environment Variable Option. The Environment Variables will open up and you can view all the system variables present there.

    After clicking on the Path option make sure to put the Scripts and Program Files path of different Python versions that you currently want to use and work in, and where you want to store all your necessary packages should be put first followed by others. Simply, click on the Browse button and select the path of the Script folder and the Python3 itself.

    Note: Remove any other Python Version available in the System variables, for example, Python2. Select its path and click on the Delete button.

    Press the OK button to save the changes in the Windows Environmental Variables.

    Now, edit the environment variables to add new Python 3 to the path.

    https://i0.wp.com/feaforall.com/wp-content/uploads/2019/12/image-3.png?ssl=1https://i1.wp.com/feaforall.com/wp-content/uploads/2019/12/image.png?ssl=1https://i2.wp.com/feaforall.com/wp-content/uploads/2019/12/image-4.png?ssl=1

    Add the two new variables as follow:

    • C:\Python38\

    • C:\Python38\Scripts

    Now, click on OK button.

    https://i2.wp.com/feaforall.com/wp-content/uploads/2019/12/image-8.png?ssl=1

     

    Its time to open the command prompt:

    https://i2.wp.com/feaforall.com/wp-content/uploads/2019/12/image-6.png?ssl=1

     

    When you type “python3” in the cmd, you should see the Python 3 interpreter opening:

    https://i2.wp.com/feaforall.com/wp-content/uploads/2019/12/image-7.png?ssl=1

     

    Step 4: Upgrade pip

    If you are trying to run pip3 for this new python install, you could run into the following problem:

    “Fatal error in launcher: Unable to create process …”

    https://i0.wp.com/feaforall.com/wp-content/uploads/2019/12/python-fatal-error-in-launcher-pip.png?ssl=1

     

    Don’t worry! You can correct that by entering:

    python3 -m install --upgrade pip

     

    Your pip will then will be upgraded and you will become able to install again Python modules.

    Once this is done, restart your Command prompt and again type python –version. Now you will find the desired version there on the system and ready to be usable by the coder.

    That’s all!

    If you are facing any problem, leave a comment below.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: