Hello,
I am trying to run a Python script that is supposed to establish a connection to a MySQL database.
I already installed the package with pip install mysq.connector
.
When I run the script, I get an error:
BASIC runtime error. An exception occurred Type: com.sun.star.script.provider.ScriptFrameworkErrorException Message: <class 'ModuleNotFoundError'>: No module named 'mysql' File "/opt/libreoffice25.2/program/pythonscript.py", line 1063, in getScript mod = self.provCtx.getModuleByUrl( fileUri ) File "/opt/libreoffice25.2/program/pythonscript.py", line 492, in getModuleByUrl exec(code, entry.module.__dict__) File "/home/uli/.config/libreoffice/4/user/Scripts/python/YX.py", line 3, in <module> import mysql.connector File "/opt/libreoffice25.2/program/uno.py", line 346, in _uno_import return _builtin_import(name, *optargs, **kwargs)
I have no idea, what that means.
It means, the »python-environment« used by your manual installation of »/opt/libreoffice25.2« is different to the »python-environment« of you OS!
possible solutions:
- use apso.oxt from here to install »mysql«
- use LO provided by your friendly-Linux-distribution, which are linked to the »OS-python-environment«