Sometimes, we need different Python versions to develop different types of software. For example, you've created two different virtual environments in Python to develop two different types of projects. However, the required packages for these two types of projects are different. The packages needed in a particular project may not be compatible with different Python versions. Then what will you do? Will you uninstall the recently installed Python version and install the required version? But it is not a practical solution.
You can install different versions of the released Python version independently on the same computer. You have to set the path of the required Python version to the computer environment. For example, you need Python version 3.8.x for a particular project, and you require Python version 3.9.x for another project.
You need to delete the old Python path in the 'System Environment Variables.' Then click the 'new' button and add the required Python version's path. It will work.
Steps
- Search 'Edit the System Environment Variables' from the start.
- Then you'll see a pop-up window named 'System Properties'
- Then click on the 'Advance' tab.
- Then, on 'Environment Variables'
- You will see another pop-up will open.
- Select 'PATH,' then click on 'Edit'
- Different types of 'paths' have already been added, including your recent Python version's path. It will look like this:
C:\Users\username\AppData\Local\Programs\Python\Python38x\Scripts;
- Then delete these recent old Python paths and click the 'New' tab. Add the current Python version's path like this
C:\Users\username\AppData\Local\Programs\Python\Python39x\Scripts;
- Then click on the 'OK' button.