Do you know we can keep multiple version of Python in our single system

How to maintain multiple versions of Python installation?

If you work on multiple projects, there would be a situation where project operates on different version of python. In such case your machine should support multiple versions of Python. In this post we will see how to install multiple versions of python in our machine.

Installing Multiple versions of Python.

First Version of Python Installation: Let us start with the installation of most latest version of python, to do this follow the below steps:

  • Goto the python release page:
    • https://www.python.org/downloads/windows/
  • Select the appropriate stable version in our case I am choosing Python 3.12
  • Download the appropriate py version window installer.
  • Make a folder in your chosen drive like python_0X.XX/Python312 and install python in it, no need to add to pythonpath. for me I choose C:\Users\vikik\Python\Python312
  • Install the python exe to chosen drive.

Second Version of Python Installation: Same step you need to perform for installing another version of python

  • Goto the python release page:
    • https://www.python.org/downloads/windows/
  • Select the appropriate stable version in our case I am choosing Python 3.10
  • Download the appropriate py version window installer.
  • Make a folder in your chosen drive like python_0X.XX/Python310 and install python in it, no need to add to pythonpath. for me I choose C:\Users\vikik\Python\Python310
  • Install the python exe to chosen drive.

Below is how you can change the location of installation

Now once the installation is complete we will have two set of python installed in our machine, you will have something similar to like this

Check the Environment PATH variable after installation of both version of python

This is the time to check the environment variable, we should get two set of python exe path if we had selected option to add python path to environment variable PATH while installation.

Now since both 311 and 312 version of python path is mentioned in the PATH variable of System, so which ever version path is on top of the environment PATH variable list that version will automatically be chosen as default interpreter when you type python – version

Running both the Version of Python interpreter

Now if we want to use both the version and don’t want to be depended on which version will be picked from through PATH variable follow the following steps

  1. Go to the folder where python exe reside for me it is ~userfolder/Python311 and ~userfolder/Python312
  2. Change the name of python.exe in Python311 folder to python311.exe
  3. Change the name of python.exe in Python312 folder to python312.exe
  4. Exit the command prompt if it is opened.
  5. Open the command prompt and type
    1. Python311 –version
    1. Python312 –version

Creating Virtual environment with specific version of python installation

To know more about Virtual environment click this- Create Virtual Environment

Follow below steps to create two project one with virtual environment python3.11 an other with virtual environment 3.12

  1. Go to the command prompt
  2. Create a project directory
    1. Mkdir myProj1
  3. Change to the project directory
    1. Cd myProj1
  4. Create Virtual environment with python311 version
    1. Python311 -m venv venv_myProj1

Your virtual environment is created for project1, follow the same step for creating Virtual Environment for project myProj312, below is the sample step

  1. Go to the command prompt
  2. Create a project directory
    1. Mkdir myProj2
  3. Change to the project directory
    1. Cd myProj2
  4. Create Virtual environment with python311 version
    1. Python311 -m venv venv_myProj2

Activate and deactivate Virtual environment

Please follow this article to understand how to activate and deactivate virtual environment.

<?pythonclass ListDictAdvanceOp:
def __init__(self):
self._found = False

def find_value_present_in_list_of_dict_way1(self, key, value_to_compare, dict_kv):
if any(dict_item[key] == value_to_compare for dict_item in dict_kv):
self._found = True
else:
self._found = False
return self._found
?>
class ListDictAdvanceOp:
    def __init__(self):
        self._found = False

    def find_value_present_in_list_of_dict_way1(self, key, value_to_compare, dict_kv):
        if any(dict_item[key] == value_to_compare for dict_item in dict_kv):
            self._found = True
        else:
            self._found = False
        return self._found
class ListDictAdvanceOp:
    def __init__(self):
        self._found = False

    def find_value_present_in_list_of_dict_way1(self, key, value_to_compare, dict_kv):
        if any(dict_item[key] == value_to_compare for dict_item in dict_kv):
            self._found = True
        else:
            self._found = False
        return self._found

One Comment

  1. Dear Website Owner,

    I hope this email finds you well. I recently discovered your website and was impressed by the quality of your content and the helpful information you offer to your audience. In light of this, I would like to propose a backlink exchange that could benefit both our websites.

    My website, https://m.cheapestdigitalbooks.com/, is focused on providing affordable digital books to readers around the world. We currently have a strong online presence with a Domain Authority (DA) of 13, a Page Authority (PA) of 52, and a Domain Rating (DR) of 78. Our website features 252K backlinks, with 95% of them being dofollow, and has established connections with 5.3K linking websites, with 23% of these being dofollow links.

    I believe that a mutually beneficial backlink exchange could be of great value for both of our websites, as it may lead to an increase in website authority and improve our search engine rankings. In this collaboration, I am willing to add backlinks from my website using your desired keywords and anchor texts. In return, I would be grateful if you could include backlinks with my desired keywords and anchor texts on your website.

    I kindly request that you visit my website, https://m.cheapestdigitalbooks.com/, to get a sense of the potential benefits this partnership could bring to your site. I am confident that this collaboration will provide a win-win situation for both parties, and I look forward to learning more about your thoughts on this proposal.

    Thank you for considering my offer. I am excited about the potential growth this partnership may bring to our websites and am eager to discuss the details further. Please do not hesitate to reach out to me at your convenience.

    Best regards,

    David E. Smith
    Email: david@cheapestdigitalbooks.com
    Address: 3367 Hood Avenue, San Diego, CA 92117

Leave a Reply

Your email address will not be published. Required fields are marked *