dw-0 / kiauh

Klipper Installation And Update Helper
GNU General Public License v3.0
3.4k stars 491 forks source link

Error installing moonraker #420

Closed mley closed 10 months ago

mley commented 10 months ago

Linux Distribution

MainSail OS 1.2.1

What happened

Moonraker was not installed, furthermore some apt dependency could not be installed: python3-libcamera python3-picamera2

What did you expect to happen

Moonraker and all its dependencies are installed correctly.

How to reproduce

git clone https://github.com/dw-0/kiauh.git ./kiao/kiao.sh 1 (Install) 2 (moonraker) y (yes)

Additional information

/=======================================================\
|     ~~~~~~~~~~~~~~~~~ [ KIAUH ] ~~~~~~~~~~~~~~~~~     |
|        Klipper Installation And Update Helper         |
|     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     |
\=======================================================/

###### Initializing Moonraker installation ...
[✓ OK] Klipper installation found!

###### Install Moonraker? (Y/n): y
   [➔] Yes

###### Installing Moonraker ...

###### Checking for the following dependencies:
● git
● wget
● curl
● unzip
● dfu-util
● virtualenv
● libjpeg-dev
● zlib1g-dev
[✓ OK] Dependencies already met!

###### Cloning Moonraker from https://github.com/Arksine/moonraker.git ...
Klone nach '/home/martin/moonraker' ...
remote: Enumerating objects: 10181, done.
remote: Counting objects: 100% (3271/3271), done.
remote: Compressing objects: 100% (253/253), done.
remote: Total 10181 (delta 3087), reused 3119 (delta 3018), pack-reused 6910
Empfange Objekte: 100% (10181/10181), 3.83 MiB | 6.29 MiB/s, fertig.
Löse Unterschiede auf: 100% (7558/7558), fertig.

###### Installing dependencies ...

###### Reading dependencies...

python3-virtualenv
python3-dev
liblmdb-dev
libopenjp2-7
libsodium-dev
zlib1g-dev
libjpeg-dev
packagekit
wireless-tools
curl

###### Installing packages...
Paketlisten werden gelesen… Fertig
Abhängigkeitsbaum wird aufgebaut… Fertig
Statusinformationen werden eingelesen… Fertig
curl ist schon die neueste Version (7.74.0-1.3+deb11u11).
libjpeg-dev ist schon die neueste Version (1:2.0.6-4).
liblmdb-dev ist schon die neueste Version (0.9.24-1).
libopenjp2-7 ist schon die neueste Version (2.4.0-3).
libsodium-dev ist schon die neueste Version (1.0.18-1).
packagekit ist schon die neueste Version (1.2.2-2).
python3-dev ist schon die neueste Version (3.9.2-3).
python3-virtualenv ist schon die neueste Version (20.4.0+ds-2+deb11u1).
wireless-tools ist schon die neueste Version (30~pre9-13.1).
zlib1g-dev ist schon die neueste Version (1:1.2.11.dfsg-2+deb11u2).
0 aktualisiert, 0 neu installiert, 0 zu entfernen und 2 nicht aktualisiert.
2 nicht vollständig installiert oder entfernt.
Nach dieser Operation werden 0 B Plattenplatz zusätzlich benutzt.
python3-libcamera (0~git20230720+bde9b04f-1) wird eingerichtet ...
Could not import runpy module
Traceback (most recent call last):
  File "/usr/lib/python3.9/runpy.py", line 15, in <module>
    import importlib.util
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 786, in exec_module
  File "<frozen importlib._bootstrap_external>", line 918, in get_code
  File "<frozen importlib._bootstrap_external>", line 587, in _compile_bytecode
EOFError: marshal data too short
Traceback (most recent call last):
  File "/usr/bin/py3compile", line 319, in <module>
    main()
  File "/usr/bin/py3compile", line 298, in main
    compile(files, versions,
  File "/usr/bin/py3compile", line 185, in compile
    cfn = interpreter.cache_file(fn, version)
  File "/usr/share/python3/debpython/interpreter.py", line 212, in cache_file
    (fname[:-3], self.magic_tag(version), last_char))
  File "/usr/share/python3/debpython/interpreter.py", line 246, in magic_tag
    return self._execute('import imp; print(imp.get_tag())', version)
  File "/usr/share/python3/debpython/interpreter.py", line 359, in _execute
    raise Exception('{} failed with status code {}'.format(command, output['returncode']))
Exception: python3.9 -c 'import imp; print(imp.get_tag())' failed with status code 1
dpkg: Fehler beim Bearbeiten des Paketes python3-libcamera (--configure):
 »installiertes python3-libcamera-Skript des Paketes post-installation«-Unterprozess gab den Fehlerwert 1 zurück
dpkg: Abhängigkeitsprobleme verhindern Konfiguration von python3-picamera2:
 python3-picamera2 hängt ab von python3-libcamera (>= 0~git20230302+923f5d70-1); aber:
  Paket python3-libcamera ist noch nicht konfiguriert.

dpkg: Fehler beim Bearbeiten des Paketes python3-picamera2 (--configure):
 Abhängigkeitsprobleme - verbleibt unkonfiguriert
Fehler traten auf beim Bearbeiten von:
 python3-libcamera
 python3-picamera2
E: Sub-process /usr/bin/dpkg returned an error code (1)
>>>>>> Installing Moonraker packages failed!

Installed python packages after failed installation attempt

$ dpkg -l | grep python
ii  libpython3-dev:armhf                 3.9.2-3                          armhf        header files and a static library for Python (default)
ii  libpython3-stdlib:armhf              3.9.2-3                          armhf        interactive high-level object-oriented language (default python3 version)
ii  libpython3.9:armhf                   3.9.2-1+rpi1                     armhf        Shared Python runtime library (version 3.9)
ii  libpython3.9-dev:armhf               3.9.2-1+rpi1                     armhf        Header files and a static library for Python (v3.9)
ii  libpython3.9-minimal:armhf           3.9.2-1+rpi1                     armhf        Minimal subset of the Python language (version 3.9)
ii  libpython3.9-stdlib:armhf            3.9.2-1+rpi1                     armhf        Interactive high-level object-oriented language (standard library, version 3.9)
ii  python-apt-common                    2.2.1                            all          Python interface to libapt-pkg (locales)
ii  python-is-python3                    3.9.2-1                          all          symlinks /usr/bin/python to python3
rc  python-matplotlib-data               3.3.4-1                          all          Python based plotting system (data package)
ii  python-pip-whl                       20.3.4-4+rpt1+deb11u1            all          Python package installer (pip wheels)
ii  python3                              3.9.2-3                          armhf        interactive high-level object-oriented language (default python3 version)
ii  python3-appdirs                      1.4.4-1                          all          determining appropriate platform-specific directories (Python 3)
ii  python3-apt                          2.2.1                            armhf        Python 3 interface to libapt-pkg
ii  python3-certifi                      2020.6.20-1                      all          root certificates for validating SSL certs and verifying TLS hosts (python3)
ii  python3-chardet                      4.0.0-1                          all          universal character encoding detector for Python3
ii  python3-colorzero                    1.1                              all          Construct, convert, and manipulate colors in a Pythonic manner.
ii  python3-debconf                      1.5.77                           all          interact with debconf from Python 3
ii  python3-dev                          3.9.2-3                          armhf        header files and a static library for Python (default)
ii  python3-distlib                      0.3.2+really+0.3.1-0.1           all          low-level components of python distutils2/packaging
ii  python3-distro                       1.5.0-1                          all          Linux OS platform information API
ii  python3-distutils                    3.9.2-1                          all          distutils package for Python 3.x
ii  python3-filelock                     3.0.12-2                         all          platform independent file locking module
ii  python3-gpiozero                     1.6.2-1                          all          Simple API for controlling devices attached to a Pi's GPIO pins.
ii  python3-idna                         2.10-1                           all          Python IDNA2008 (RFC 5891) handling (Python 3)
ii  python3-importlib-metadata           1.6.0-2                          all          library to access the metadata for a Python package - Python 3.x
ii  python3-iniparse                     0.4-3                            all          access and modify configuration data in INI files (Python 3)
ii  python3-kms++                        0~git20221104~171243+adc05b6-1   armhf        C++ library for kernel mode setting - python3 bindings
ii  python3-lib2to3                      3.9.2-1                          all          Interactive high-level object-oriented language (lib2to3)
iF  python3-libcamera                    0~git20230720+bde9b04f-1         armhf        complex camera support library (Python 3 bindings)
ii  python3-libgpiod:armhf               1.6.2-1+rpi1                     armhf        Python bindings for libgpiod (Python 3)
ii  python3-minimal                      3.9.2-3                          armhf        minimal subset of the Python language (default python3 version)
ii  python3-more-itertools               4.2.0-3                          all          library with routines for operating on iterables, beyond itertools (Python 3)
ii  python3-numpy                        1:1.19.5-1                       armhf        Fast array facility to the Python 3 language
iU  python3-picamera2                    0.3.12-2                         all          Libcamera based python library
ii  python3-pidng                        4.0.9-1                          armhf        Create Adobe DNG RAW files using Python (Python 3)
ii  python3-piexif                       1.1.3-1                          all          Exif manipulation with pure python script (Python 3)
ii  python3-pil:armhf                    8.1.2+dfsg-0.3+deb11u1           armhf        Python Imaging Library (Python3)
ii  python3-pip                          20.3.4-4+rpt1+deb11u1            all          Python package installer
ii  python3-pkg-resources                52.0.0-4                         all          Package Discovery and Resource Access using pkg_resources
ii  python3-prctl                        1.7-2+b2                         armhf        Python interface to the prctl() syscall (Python 3)
ii  python3-requests                     2.25.1+dfsg-2                    all          elegant and simple HTTP library for Python3, built for human beings
ii  python3-rpi.gpio                     0.7.0-0.2+b1                     armhf        Module to control Raspberry Pi GPIO channels (Python 3)
ii  python3-serial                       3.5~b0-1                         all          pyserial - module encapsulating access for the serial port
ii  python3-setuptools                   52.0.0-4                         all          Python3 Distutils Enhancements
ii  python3-simplejpeg                   1.6.4-1                          armhf        Simple package for fast JPEG encoding and decoding
ii  python3-six                          1.16.0-2                         all          Python 2 and 3 compatibility library (Python 3 interface)
ii  python3-spidev                       20200602~200721-1                armhf        Bindings for Linux SPI access through spidev (Python 3)
ii  python3-tk:armhf                     3.9.2-1                          armhf        Tkinter - Writing Tk applications with Python 3.x
ii  python3-toml                         0.10.1-1                         all          library for Tom's Obvious, Minimal Language - Python 3.x
ii  python3-urllib3                      1.26.5-1~exp1                    all          HTTP library with thread-safe connection pooling for Python3
ii  python3-v4l2                         0.3.2-1                          all          Python bindings for the v4l2 userspace api
ii  python3-virtualenv                   20.4.0+ds-2+deb11u1              all          Python virtual environment creator
ii  python3-wheel                        0.34.2-1                         all          built-package format for Python
ii  python3-zipp                         1.0.0-3                          all          pathlib-compatible Zipfile object wrapper - Python 3.x
ii  python3.9                            3.9.2-1+rpi1                     armhf        Interactive high-level object-oriented language (version 3.9)
ii  python3.9-dev                        3.9.2-1+rpi1                     armhf        Header files and a static library for Python (v3.9)
ii  python3.9-minimal                    3.9.2-1+rpi1                     armhf        Minimal subset of the Python language (version 3.9)
dw-0 commented 10 months ago

Moonraker was not installed, furthermore some apt dependency could not be installed: python3-libcamera python3-picamera2

Those two packages are not even Moonraker dependencies. I wonder why you even encounter any error. MainsailOS has usually everything pre-installed. That also means all required dependencies.

mley commented 10 months ago

It looks like there were some outdated compiled python files. This post made my try to delete all python packages __pycache__ folders.

sudo rm -r /usr/lib/python3/**/__pycache__

After that the python3-picamera and package and moonraker could be installed.

Maybe this info helps someone else. Use at you own risk. :ihavenoideawhatimdoingdog: