Rolf-Hempel / PlanetarySystemStacker

Produce a sharp image of a planetary system object (moon, sun, planets) from many seeing-affected frames according to the "lucky imaging" technique.
275 stars 32 forks source link

Cannot run PSS from the CLI without display on ubuntu (headless) #61

Closed timing closed 1 year ago

timing commented 1 year ago

I want to run PSS "in the cloud". I booted a fresh VPS with Ubuntu 22.04 and did the following:

apt update
apt install python3-pip
pip3 install planetary-system-stacker

Then I run the following:

PlanetarySystemStacker 01022023205211-trimmed.mov -p -b 4 -s 25 -a 52 -w 20 –n --drizzle 1.5x

(this is from the example in the documentation PDF)

But it errors on QT stuff. I'd assume running the tool headless does not need QT right?

Traceback (most recent call last):
  File "/usr/local/bin/PlanetarySystemStacker", line 5, in <module>
    from planetary_system_stacker.planetary_system_stacker import main
  File "/usr/local/lib/python3.10/dist-packages/planetary_system_stacker/planetary_system_stacker.py", line 42, in <module>
    from PyQt5 import QtWidgets, QtCore, QtGui
ImportError: libGL.so.1: cannot open shared object file: No such file or directory
Rolf-Hempel commented 1 year ago

Hi Tijmen,

The CLI does not use any GUI for user interaction, but it still uses the QT signals (from QtCore). Is PyQt5 not installed on your system?

All the best, Rolf

timing commented 1 year ago

The system I use does not have a display (it's on a VPS), so it cannot connect to the display, hence the error. I fix this by running Xfvb, which sets up a virtual display. However this takes quite some memory, and shows that PSS is not really a "true CLI tool", which is maybe not one of your goals, but I would like that :-).

Rolf-Hempel commented 1 year ago

You are right: PSS primarily is a GUI tool. As you can see in the code, the CLI version shares most of the code with the GUI version. I only wanted to give users the opportunity to integrate PSS in more complex workflows for automation. I guess that creating a PSS version with all the QT stuff removed would take some time. :-(