Problem getting Python scripts running

Distributor ID: Ubuntu
Description: Ubuntu 23.10
Release: 23.10
Codename: mantic
LibreOffice LibreOffice 7.6.4.1 60(Build:1)
geany geany 1.38 (built on 2021-10-14 with GTK 3.24.30, GLib 2.68.4)
Python Python 3.11.6

I was having problems starting my LO so I decided to unistall and reinstall from the Ubuntu Store, I ended up with a snap version of LO…as above. In my previous version, I had my python scripts running very nicely…now, having transferred the python scripts to the new Python Directory in the new LO, I get the following error whenever I try to run a script!

Connector : couldn’t connect to socket (Connection refused) at /build/libreoffice/parts/libreoffice/build/io/source/connector/connector.cxx:118

I have tried asking Chat GPT 4 what I should do. It gave me this answer (amongst others):

If you’re running a script or a service that interacts with LibreOffice, make sure to start LibreOffice in server mode correctly, which is usually done with a command similar to:

sh

soffice --headless --accept="socket,host=127.0.0.1,port=8100;urp;"

This command tells LibreOffice to run in headless mode (without a GUI) and accept connections on localhost (127.0.0.1) on port 8100. If you’re using a different port or host, you’ll need to adjust the command accordingly.

However that made no difference and I still get the same error. What have I done wrong…and what am I missing?

I’m missing an information on your previous setup, as your

seems to hint you didn’t always us a snap.

Have you created a container, wich is allowed to offer ports to the system?

1 Like

As i has told you seven years ago : executing python from the Libreoffice-GUI dont need a socket- or pipe-connection.

1 Like

All sorted, thank you. Downgrading was the answer.