Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (47.6k points)

I have a Python 2.7.11 installed on one of my LAB stations. I would like to upgrade Python to at least 3.5.

How should I do that? Should I prefer to completely uninstall 2.7.11 and then install the new one? Is there a way to update it? Is an update a good idea?

2 Answers

0 votes
by (106k points)

You can use pip to upgrade a package. It is super easy and recommended too.

pip install python --upgrade 

OR 

pip install python -U

To know more about this you can have a look at the following video tutorial:-

0 votes
by (108k points)

If there are several Python versions installed on the system and you want to work with a project that is using some previous version 

of Python, then you can use the virtual environment e.g. (new_env) you can upgrade Python just in that venv using:

python -m new_env --upgrade "your virtual environment path"

For example, if we are having Python 3.7 in ./new_env virtual environment and you would like to upgrade venv to Python 3.8, then you can simply execute the below code:

python -m new_env --upgrade ./new_env

If you want to know more about Python, then do refer to the Python course

Related questions

0 votes
2 answers
+1 vote
1 answer
asked Sep 26, 2019 in SQL by chandra (29.3k points)
0 votes
1 answer
asked Jul 9, 2020 in Python by ashely (50.2k points)

Browse Categories

...