I have python3 installed on Ubuntu 20.04, and I have an application that needs python 2.7 installed. After installation of python 2.7 it looks like python cannot be found
/usr/bin/python: bad interpreter: No such file or directory which python, which python2 and which python3 do not return any results
Here's the content of /usr/bin:
root@ip-10-10-10-201:/home/ubuntu# ls -alh /usr/bin/pyt* lrwxrwxrwx 1 root root 9 Mar 13 2020 /usr/bin/python2 -> python2.7 -rwxr-xr-x 1 root root 3.5M Aug 4 11:16 /usr/bin/python2.7 lrwxrwxrwx 1 root root 9 Mar 13 2020 /usr/bin/python3 -> python3.8 lrwxrwxrwx 1 root root 16 Mar 13 2020 /usr/bin/python3-config -> python3.8-config -rwxr-xr-x 1 root root 5.3M Jul 28 12:59 /usr/bin/python3.8 lrwxrwxrwx 1 root root 33 Jul 28 12:59 /usr/bin/python3.8-config -> x86_64-linux-gnu-python3.8-config I'm not sure how to get this working, if I need both pythons (2.7 and 3.8) to be working. Should I change the #!/usr/bin/python in the scripts that require phyton2 to #!/usr/bin/python2 ?
Will appreciate your help. Happy holidays!
source ~/.bash_profile/usr/bin/pythonin this output fromls? In order to use the correct interpreter, you should specify a path to the existing executable. Thus, you can use/usr/bin/python2or/usr/bin/python2.7. The shebang normally looks like#!/usr/bin/env python.python, you have to explicitly choose betweenpython-is-python2orpython-is-python3./usr/bin/pythonto one or the other, that doesn't mean it's correct for any arbitrary script that specifies/usr/bin/python. It's probably better to update the script to be explicitly.