roidy
1 January 2025 14:12
1
With the latest 21.1 nightly 20241231 Kodi-Send no longer works, it returns the following error:-
**CoreELEC:****~** # kodi-send
Traceback (most recent call last):
File "/usr/bin/kodi-send", line 27, in <module>
from kodi.xbmcclient import *
ModuleNotFoundError: No module named 'kodi'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/bin/kodi-send", line 30, in <module>
from xbmcclient import *
ModuleNotFoundError: No module named 'xbmcclient'
Found this thread with the same error, but the solution no longer works.
SSH kodi-send command does not work, the error is this:
x96air1:~ # kodi-send
Traceback (most recent call last):
File "/usr/bin/kodi-send", line 27, in <module>
from kodi.xbmcclient import *
ModuleNotFoundError: No module named 'kodi'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/bin/kodi-send", line 30, in <module>
from xbmcclient import *
ModuleNotFoundError: No module named 'xbmcclient'
(Tested on CoreELEC 19…
It is this:
xbmc:Omega
← hbiyik:Omega-retire-distutils
opened 10:52PM - 21 Dec 24 UTC
backport of https://github.com/xbmc/xbmc/pull/25211
Sadly the issue was not fixed on Kodi Piers but now they introduce also to Omega.
opened 11:30AM - 29 May 24 UTC
Triage: Needed
## Bug report
### Describe the bug
Here is a clear and concise description of … what the problem is:
With [PR 25211](https://github.com/xbmc/xbmc/pull/25211) kodi python packages are installed into wrong folder and kodi-send script doesn't work anymore.
```
$ kodi-send --action="TakeScreenshot"
Traceback (most recent call last):
File "/usr/bin/kodi-send", line 27, in <module>
from kodi.xbmcclient import *
ModuleNotFoundError: No module named 'kodi'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/bin/kodi-send", line 30, in <module>
from xbmcclient import *
ModuleNotFoundError: No module named 'xbmcclient'
```
Python function get_path from sysconfig returns full path like this
`/data/LibreELEC.tv/build.LibreELEC-Generic.x86_64-13.0-devel/toolchain/x86_64-libreelec-linux-gnu/sysroot/usr/lib/python3.11/site-packages`
instead of short one like this using get_python_lib from distutils
`lib/python3.11/site-packages`
and then python files like xbmcclient.pyc are installed into wrong path
## Expected Behavior
Here is a clear and concise description of what was expected to happen:
Install python packages into same folder as before and having kodi-send working.
```
kodi-21.0-Omega
build.LibreELEC-Generic.x86_64-13.0-devel/build/kodi-21.0-Omega/tools/EventClients/lib/python/xbmcclient.py
build.LibreELEC-Generic.x86_64-13.0-devel/image/system/usr/lib/python3.11/site-packages/kodi/xbmcclient.pyc
build.LibreELEC-Generic.x86_64-13.0-devel/toolchain/x86_64-libreelec-linux-gnu/sysroot/usr/lib/python3.11/site-packages/kodi/xbmcclient.py
build.LibreELEC-Generic.x86_64-13.0-devel/install_pkg/kodi-21.0-Omega/usr/lib/python3.11/site-packages/kodi/xbmcclient.pyc
```
notice
`/usr/lib/python3.11/site-packages/kodi/xbmcclient.pyc`
## Actual Behavior
```
kodi-42120bb9047912b9379dadffdbdef9968062cf70
build.LibreELEC-Generic.x86_64-13.0-devel/build/kodi-42120bb9047912b9379dadffdbdef9968062cf70/tools/EventClients/lib/python/xbmcclient.py
build.LibreELEC-Generic.x86_64-13.0-devel/image/system/data/LibreELEC.tv/build.LibreELEC-Generic.x86_64-13.0-devel/toolchain/x86_64-libreelec-linux-gnu/sysroot/usr/lib/python3.11/site-packages/kodi/xbmcclient.py
build.LibreELEC-Generic.x86_64-13.0-devel/toolchain/x86_64-libreelec-linux-gnu/sysroot/data/LibreELEC.tv/build.LibreELEC-Generic.x86_64-13.0-devel/toolchain/x86_64-libreelec-linux-gnu/sysroot/usr/lib/python3.11/site-packages/kodi/xbmcclient.py
build.LibreELEC-Generic.x86_64-13.0-devel/install_pkg/kodi-42120bb9047912b9379dadffdbdef9968062cf70/data/LibreELEC.tv/build.LibreELEC-Generic.x86_64-13.0-devel/toolchain/x86_64-libreelec-linux-gnu/sysroot/usr/lib/python3.11/site-packages/kodi/xbmcclient.py
```
notice
`/data/LibreELEC.tv/build.LibreELEC-Generic.x86_64-13.0-devel/toolchain/x86_64-libreelec-linux-gnu/sysroot/usr/lib/python3.11/site-packages/kodi/xbmcclient.py`
## Possible Fix
Some prefix needs to be stripped
`execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "from sysconfig import get_path; print(get_path('platlib', scheme='posix_prefix', vars={'platbase': '${CMAKE_INSTALL_PREFIX}'}))"
`
Two references:
https://github.com/rdkit/rdkit/blob/master/CMakeLists.txt#L352-L355
https://github.com/rpm-software-management/libdnf/commit/f1cffbfb9f338da827e233c2d8ac3a25a6a59a69
### To Reproduce
Steps to reproduce the behavior:
1.
2.
3.
### Debuglog
The debuglog can be found here:
### Screenshots
Here are some links or screenshots to help explain the problem:
## Additional context or screenshots (if appropriate)
Here is some additional context or explanation that might help:
### Your Environment
Used Operating system:
- [ ] Android
- [ ] iOS
- [ ] tvOS
- [ ] Linux
- [ ] macOS
- [ ] Windows
- [ ] Windows UWP
- [x] LibreELEC
- Operating system version/name: LibreELEC 13
- Kodi version: kodi-42120bb9047912b9379dadffdbdef9968062cf70
*note: Once the issue is made we require you to update it with new information or Kodi versions should that be required.
Team Kodi will consider your problem report however, we will not make any promises the problem will be solved.*
Export variable PYTHONPATH
before using kodi-send
:
export PYTHONPATH=/home/docker/build_dir/CoreELEC-21/build.CoreELEC-Amlogic-ne.aarch64-21/toolchain/aarch64-libreelec-linux-gnu/sysroot/usr/lib/python3.11/site-packages/kodi
1 Like
roidy
1 January 2025 15:40
5
Perfect thank you
To save typing this ever SSH session do the following:-
echo "export PYTHONPATH=/home/docker/build_dir/CoreELEC-21/build.CoreELEC-Amlogic-ne.aarch64-21/toolchain/aarch64-libreelec-linux-gnu/sysroot/usr/lib/python3.11/site-packages/kodi" > .profile
1 Like