Thursday, April 18, 2024
 Popular · Latest · Hot · Upcoming
9
rated 0 times [  9] [ 0]  / answers: 1 / hits: 11594  / 2 Years ago, sun, april 10, 2022, 12:45:24

I need to have 2 versions of Python installed on my PC. The first must be the latest version in order to use youtube-dl, and the second must be the 2.7 version for a course that says we must not upgrade to get the same results.



I'm on Ubuntu 12.04. How can I have two different versions of Python without using virtual machines?


More From » python

 Answers
6

You can just install them alongside eachother.



sudo apt-get install python2.7 python3


I think by default Python 2.7 will be used (i.e. is symlinked to /usr/bin/python). You can change this by changing that symlink. Most Python programs will specify which version they need and use it automatically.



Changing the symlink is not advised, as it is likely to cause programs to return errors.


[#35161] Sunday, April 10, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
atchcommo

Total Points: 114
Total Questions: 130
Total Answers: 101

Location: Cook Islands
Member since Sat, Oct 16, 2021
3 Years ago
;