Issue
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!
Solution
As suggested by @ForceBru, changing the scripts from /usr/bin/python
to /usr/bin/python2
seems to work.
This is due to the fact that Ubuntu Python packages are always coming as python2 and python3, not python.
Answered By - igalsc
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.