2023-02-22, 15:06
Sorry sorry sorry, I'm very new to Python and only using it in the context of trying to develop an addon for my Kodi skin. trying to get my head around importing of packages.
In VSCode I see certain warning for xbmc packages with Pylance saying they can't be resolved because they are missing from my environment (e.g. import xbmcgui). I understand this not to be a problem because Kodi includes these packages so the addon can use them fine within the kodi environment. Anyone who installs the addon will also have Kodi so they will always have access to them. However other simple packages I have used like json, urlparse and sys do not come with warnings. Does this mean they are installed in my local environment already? Do I need to make sure that they are also included in Kodi environment? I assume they are as lots of people use them...
I want to try and import a third-party package to be able to manipulate images from the Kodi library (Pillow for cropping clearlogos). I get the same warnings with 'From PIL import Image'. I read (https://kodi.wiki/view/Category:Add-on_l...es/modules) I can access some third-party packages as other addons and include missing ones in my addon. But I couldn't find any examples of this to follow. Would this need to be done for PIL or would this already be in Kodi environment?
Is there a way to point my VSCode environment to Kodi somehow so it knows what's available and what's not?
Apologies again. The more I read the more confused I'm getting.
In VSCode I see certain warning for xbmc packages with Pylance saying they can't be resolved because they are missing from my environment (e.g. import xbmcgui). I understand this not to be a problem because Kodi includes these packages so the addon can use them fine within the kodi environment. Anyone who installs the addon will also have Kodi so they will always have access to them. However other simple packages I have used like json, urlparse and sys do not come with warnings. Does this mean they are installed in my local environment already? Do I need to make sure that they are also included in Kodi environment? I assume they are as lots of people use them...
I want to try and import a third-party package to be able to manipulate images from the Kodi library (Pillow for cropping clearlogos). I get the same warnings with 'From PIL import Image'. I read (https://kodi.wiki/view/Category:Add-on_l...es/modules) I can access some third-party packages as other addons and include missing ones in my addon. But I couldn't find any examples of this to follow. Would this need to be done for PIL or would this already be in Kodi environment?
Is there a way to point my VSCode environment to Kodi somehow so it knows what's available and what's not?
Apologies again. The more I read the more confused I'm getting.