hi, new user here, hope you guys can help me. First off:
OS: Windows 10, 64 Bit.
Python: 64 bit.
Packages installed: wmi, pypiwin32 and 64 bit pywin32
My problem: I have a little script which reads my network information. In Python itself it's working.
But I am using it for Kodi (64 bit). Right now it's not an add-on, just a script. And whenever I run the script in Kodi I get this error:
Quote:import win32api, sys, os
ImportError: Module use of python37.dll conflicts with this version of Python.
I have also tried to use Python and Kodi with 32 bit. But the problem persists.
I have absolutely no idea what else I can do. It's been a few exhausting days of countless hours of research. :( Which lead me to this forum. Hope you are able to help me.
Thank you!
What version of Python are you using?
Latest stable version: 7.3.4
I'm open to anything. I tried latest Python 2 too.
I also tried the 32 bit versions of latest Python 2 and 3.
Zilch.
(Aug-22-2019, 07:05 PM)NonSufficitOrbis Wrote: [ -> ]And whenever I run the script in Kodi I get this error:
Are you using Python interpreter that's comes with kodi or do try to us OS Python?
About Add-ons
kodi Wrote:Kodi includes a built-in Python interpreter that allows users to develop add-ons (scripts and plugins) that interface easily and cleanly with the Kodi dashboard.
Basic test to see what's used.
E:\div_code\foo
λ python -V
Python 3.7.3
# Placement of Python interpreter used also python.exe
# When us kodi version of Python,then it will be where they have placed python.exe
E:\div_code\foo
λ python -c "import sys; print(sys.executable)"
C:\python37\python.exe
# Where pip install to
E:\div_code\foo
λ pip -V
pip 19.2.1 from c:\python37\lib\site-packages\pip (python 3.7)
NonSufficitOrbis Wrote:import win32api, sys, os
ImportError: Module use of python37.dll conflicts with this version of Python.
There is no problem to build it with
venv virtual environment,to avoid conflict.
I not sure if you should OS Python or there version of Python when use kodi,have you looked into this?
Thank you snippsat for your reply. I am not too sure how to check whether I am using Kodi interpreter or Python. I copied my script and modules to both 1) C:\python37\lib\site-packages\ as well as to 2) C:\Program Files\Kodi\system\Python\Lib\site-packages with the same result.
python -V and pip -V both point to the same directory. C:\python37\python.exe and c:\python37\lib\site-packages\pip
Hope that helps!
This is kodi interpreter placement C:\Program Files\Kodi\system\Python\
Go into this folder(cd in) from cmd.
Then python -V
to see what version of Python they use.
There will be a folder C:\Program Files\Kodi\system\Python\Scripts
,
go into this folder and pip -V
.
So using Kodi Python interpreter as you probably should use,place your script in C:\Program Files\Kodi\system\Python\
Then can run from cmd with python my_script.py
most be in folder over doing this,now it will use kodi version of Python.
Install the normal way would be using pip
that placed in C:\Program Files\Kodi\system\Python\Scripts
When in this folder from cmd pip install something
.
You most read there doc about this,they may have some own way of doing this stuff.
Thank you snippsat.
I did your test, but unfortunately the python -V command only shows what version of python I have installed. It didn't matter what folder I executed the command from. Always just my version, not Kodi's...
I am giving up for now. Nothing works :(
Thanks anyways!