You are running into a Python environment conflict because LibreOffice Calc uses its own embedded Python interpreter, which can be tricky to work around when trying to also use a global Python interpreter Attempt using IPC ( Inter-Process Communication ). You can separate the two parts entirely by using IPC methods to communicate between the LibreOffice Python and your global Python.