-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Best Practice for referencing the script.module.kodi-six library #9
Comments
I don't understand what you are trying to achieve. |
I'm attempting to fix a broken Scrubs python script within my existing kodi installation. Initially, the python script I am working on couldn't find the referenced modules, but I found it was because they weren't in the PYTHONPATH or sys.path. However, even after adding the script.modules.kodi-six library to the PYTHONPATH or sys.path, it continues to have the issues that I referenced in the original post; while, the non-kodi-six libraries work without issue. |
Still don't understand what you are talking about. Normally, you don't need to manipulate |
In any case this library is no longer relevant. Current Kodi versions use Python 3 runtime for addons and you should use idiomatic Python 3 for your addons. As for a specific Python version, 3.8 is a safe bet for all platforms. |
@romanvm Scrubs v2 is an older add-on developed by @jewbmx that still incorporates script.module.kodi-six. It is referenced correctly in plugin.video.scrubsv2/addon.xml: I'm simply trying to fix one of the components of Scrubs v2 and test it at the command-line. $ python3 fmovies_vision.py Which is where I run into various module "ModuleNotFoundError" errors, etc. Thank you for your time and assistance. Respectfully, Gary |
You shoul have mentioned from the start that you are trying to run this outside Kodi. |
Roman,
I am running into issues referencing the script.module.kodi-six library and wondering what is the best practice for referencing it?
It doesn't seem to matter whether I reference it within the PYTHONPATH or sys.path. It still runs into issues.
export PYTHONPATH=/Kodi/addons/script.module.kodi-six/libs:/Kodi/addons/script.module.kodi-six/libs/kodi_six
OR
import sys
sys.path.append("/Kodi/addons/script.module.kodi-six/libs")
sys.path.append("/Kodi/addons/script.module.kodi-six/libs/kodi_six")
print(sys.path)
Kodi/addons/script.module.kodi-six/libs/kodi_six/xbmc.py", line 10, in
from .utils import PY2 as _PY2, ModuleWrapper as _ModuleWrapper
ImportError: attempted relative import with no known parent package
It seems to get further, if I more explicitly define the .util module as kodi_six.util.
cd Kodi/addons/script.module.kodi-six/libs/kodi_six/
sed "s/.utils/kodi_six.utils/g" xbmc*.py | grep "utils"
from kodi_six.utils import PY2 as _PY2, ModuleWrapper as _ModuleWrapper
from kodi_six.utils import PY2 as _PY2, ModuleWrapper as _ModuleWrapper
from kodi_six.utils import PY2 as _PY2, ModuleWrapper as _ModuleWrapper
from kodi_six.utils import PY2 as _PY2, ModuleWrapper as _ModuleWrapper
from kodi_six.utils import PY2 as _PY2, ModuleWrapper as _ModuleWrapper
from kodi_six.utils import PY2 as _PY2, ModuleWrapper as _ModuleWrapper
sed -i.orig "s/.utils/kodi_six.utils/g" xbmc*.py
However, I still run into issues further down the line.
Kodi/addons/plugin.video.scrubsv2/resources/lib/modules/control.py", line 28, in
addon = xbmcaddon.Addon
AttributeError: module 'kodi_six.xbmcaddon' has no attribute 'Addon'
Do you have any guidance on the best practice for referencing the script.module.kodi-six library?
Thank You.
Gary
The text was updated successfully, but these errors were encountered: