Kodi-send does not exist Bad interpreter Ubuntu 20.04.
#1
I just ran into this when trying to sort why my machines wouldn't shut down with my script.

On Ubuntu 20.04 Python is linked a different way than before in /usr/bin. Both python2.* and python3.* are linked to python2, and python 3 respectively. The kodi-send command is looking for python. As such I got the topic error on trying to fire it. I created a symlink from python2 > python under /usr/bin/ and solved the issue.

I'm unsure how to file this as a bug report as filing an issue asks for much more information than is needed, most of it not showing any problems. The problem is in the symlinks in /usr/bin/ on Focal, or lack thereof.

The only reason I know this is a change in 20.04 is that I just recently upgraded myself from 18.04. My script hasn't changed so it had to be the 20.04 change.
Reply
#2
I'm no expert but can you also define this in a shebang within /usr/bin/kodi-send itself?
Code:
#!/usr/bin/python2
Need help programming a Streamzap remote?
Reply
#3
That would also solve it. Either way /usr/bin/python no longer exists.

It's a packaging issue more than a bug. I'm not sure how to report that properly.

*EDIT* I just filed a but report, I hope properly. Will see what happens.
Reply
#4
^^ @wsnipex
Reply
#5
are you using v18 or v19? It is correct on v19 builds:
$ lsb_release -a
No LSB modules are available.
Distributor ID:    Ubuntu
Description:    Ubuntu 20.04.1 LTS
Release:    20.04
Codename:    focal

$ head -1 /usr/bin/kodi-send
#!/usr/bin/python3

$ dpkg -S /usr/bin/kodi-send
kodi-eventclients-kodi-send: /usr/bin/kodi-send

$ apt policy kodi-eventclients-kodi-send
kodi-eventclients-kodi-send:
  Installed: 2:19.0+git20201103.0450-f60adf0651-0~focal
  Candidate: 2:19.0+git20201103.0450-f60adf0651-0~focal
  Version table:
 *** 2:19.0+git20201103.0450-f60adf0651-0~focal 500
        500 http://ppa.launchpad.net/team-xbmc/xbmc-nightly/ubuntu focal/main amd64 Packages
        500 http://ppa.launchpad.net/team-xbmc/xbmc-nightly/ubuntu focal/main i386 Packages
        100 /var/lib/dpkg/status
     2:19.0+git20201027.0300-ac48ff40d0-0focal 500
        500 http://ppa.launchpad.net/team-xbmc/xbmc-nightly/ubuntu focal/main amd64 Packages
        500 http://ppa.launchpad.net/team-xbmc/xbmc-nightly/ubuntu focal/main i386 Packages
     2:18.6+dfsg1-2ubuntu1 500
        500 http://at.archive.ubuntu.com/ubuntu focal/universe amd64 Packages
        500 http://at.archive.ubuntu.com/ubuntu focal/universe i386 Packages


for v18: Kodi uses and needs python 2, which commonly means /usr/bin/python.
I'm not going to push new packages because of this, just fix it on your system.
Reply
#6
(2020-11-04, 20:53)jmgibson1981 Wrote: That would also solve it. Either way /usr/bin/python no longer exists.
Isn't that a fault at OS level?

I thought /usr/bin/python should be symlinked to the latest version, so shebangs always pick up the OS default.  Most package updates usually take care of that.
Reply
#7
(2020-11-21, 14:05)Preacher Wrote: Isn't that a fault at OS level?

Nope, this is documented.

https://wiki.debian.org/Python (same applies to ubuntu as ubuntu inherits most of debian's advantages and flaws )
Quote:NOTE: Debian testing (bullseye) has removed the "python" package and the '/usr/bin/python' symlink due to the deprecation of Python 2. No packaged scripts should depend on the existence of '/usr/bin/python': if they do, that is a bug that should be reported to Debian. You can use the 'python-is-python3' or 'python-is-python2' packages to restore an appropriate '/usr/bin/python' symlink for third-party or legacy scripts. 
Edit: In the case of kodi-send I totally agree that the best way to fix it would be to simply change the shebang locally.
Reply
#8
(2020-11-21, 17:27)asavah Wrote:
(2020-11-21, 14:05)Preacher Wrote:
Code:
Isn't that a fault at OS level?

Nope, this is documented.
Ahh... I see!

Would it be better to use
python:
#!/usr/bin/env python
as the first line, rather than explicitly specify a version?

At least that way it's delegating the location of the python binary to the OS and decoupling it from environment presumptions.
Reply
#9
On Arch both python2 and python3 (called just python) co-exist so that's why I recommended it.  I do not know about others distros.
Need help programming a Streamzap remote?
Reply
#10
(2020-11-21, 21:50)Preacher Wrote: Would it be better to use #!/usr/bin/env pythonPython as the first line, rather than explicitly specify a version?
No, because on debian based distros there is no "python" by default now, unless you install a python-is-python* package.

/usr/bin/env python2 makes sense tho.
 
(2020-11-21, 22:39)graysky Wrote: On Arch both python2 and python3 (called just python) co-exist so that's why I recommended it.  I do not know about others distros.

On arch /usr/bin/python is a symlink to /usr/bin/python3.
On debian the decision was that this might cause unexpected issues with legacy stuff, so it's better to fail because of missing shebang and let the user examine and fix the situation, rather then do something unexpected.
Reply

Logout Mark Read Team Forum Stats Members Help
Kodi-send does not exist Bad interpreter Ubuntu 20.04.0