Problem mit PERL auf Debian Bullseye - Duration.pm nicht gefunden

Begonnen von roli, 07 Oktober 2024, 17:31:46

Vorheriges Thema - Nächstes Thema

roli

Ich war gezwungen meine FHEM neu zu installieren und hänge jetzt an Perl Fehlern.

2024.10.07 17:08:54 1: reload: Error:Modul 99_myUtils deactivated:
 Can't locate DateTime/Format/Duration.pm in @INC (you may need to install the DateTime::Format::Duration module) (@INC contains: /opt/fhem /opt/fhem/lib /opt/fhem/FHEM . /etc/perl /usr/local/lib/arm-linux-gnueabihf/perl/5.32.1 /usr/local/share/perl/5.32.1 /usr/lib/arm-linux-gnueabihf/perl5/5.32 /usr/share/perl5 /usr/lib/arm-linux-gnueabihf/perl-base /usr/lib/arm-linux-gnueabihf/perl/5.32 /usr/share/perl/5.32 /usr/local/lib/site_perl) at /opt/fhem/FHEM/99_myUtils.pm line 28, <$fh> line 4.
BEGIN failed--compilation aborted at /opt/fhem/FHEM/99_myUtils.pm line 28, <$fh> line 4.


Ich habe jetzt auf meinem System gesucht  und finde folgendes :

$ find /usr  -type f -iname "Duration.pm"
/usr/lib/arm-linux-gnueabihf/perl5/5.32/DateTime/Duration.pm
 

Die Datei  hat  -rwxrwx  root root   

Kann mir jemand einen Tip geben was faul ist .

Auf einem älteren Raspi siht es etwas anders aus -- da habe ich keine Probleme :

find /usr  -type f -iname "Duration.pm"
/usr/lib/perl5/DateTime/Duration.pm
/usr/local/share/perl/5.14.2/DateTime/Format/Duration.pm

In meinem /usr/local/share    gibt es kein Perl verzeichnis

FHEM auf Debian (RASPI), 2 * CUL868/433 *&nbsp; FS20 STR, 2 * HMS100 T, 2 *&nbsp;, 1* FS20 SU, 2 *&nbsp; FS20 SM8, 2 ; 1-wire Temp,i2c Bus; ESP32 WROOM; ESP8266; Arduino
Sonnenbatterie Eco8;Elektro&nbsp; Nachspeicher-Ofen Ladesteuerung,
Haus Lüftung,
Integration von HardwareAlarmanlag

betateilchen


DateTime/Format/Duration.pm
ist halt nicht das gleiche wie

<pfad>/DateTime/Duration.pm
Zeig doch mal die Stelle in der 99_myUtils.pm, an der Du das Modul einbindest. Eventuell reicht es schon, wenn es dort korrigierst.
-----------------------
Formuliere die Aufgabe möglichst einfach und
setze die Lösung richtig um - dann wird es auch funktionieren.
-----------------------
Lesen gefährdet die Unwissenheit!

roli

HAllo. Vielen Dank für die schnelle Antwort. 
Ok - PERL ist nicht meine Sprache mit tiefem Verständnis - aber du hast mich auf eine mögliche Lösung gebracht.
Wie gesagt habe ich 2 RASPI mit FHEm am laufen.

1.   Raspberry PI 3  Model b  REv 1.2
             --  "Raspbian GNU/Linux 7 (wheezy)

2.  Raspberry  Pi Model B Rev 2
             -- "Raspbian GNU/Linux 11 (bullseye)


Der 2. ist abgekackt und ich hatte kein Image gesichert - also musste ich neu Installieren -
war ursprücglich ach eher  wheezy.
Aber jetzt auf bullseye  läuft der FHEM code eben mit den Fehlern .

Ich habe jetzt mal geschaut was PERL macht und hoffe mein Ansatz ist korrekt !?

Fhem  DAtei  : 99_myutils.pm 

..
use DateTime;
use DateTime::Format::Strptime;
use DateTime::Format::Duration;
...

so ist es auch auf whezzy in 1.  ohne Probleme

Folgendes bekomme ich wenn ich  PERL simuliere :

Auf Whezzy:
sudo perl -le'use DateTime::Format::Duration; print $INC{"DateTime/Format/Duration.pm"}'

/usr/local/share/perl/5.14.2/DateTime/Format/Duration.pm


Auf bullseye:

sudo perl -le'use DateTime::Format::Duration; print $INC{"DateTime/Format/Duration.pm"}'

Can't locate DateTime/Format/Duration.pm in @INC (you may need to install the DateTime::Format::Duration module) (@INC contains: /etc/perl /usr/local/lib/arm-linux-gnueabihf/perl/5.32.1 /usr/local/share/perl/5.32.1 /usr/lib/arm-linux-gnueabihf/perl5/5.32 /usr/share/perl5 /usr/lib/arm-linux-gnueabihf/perl-base /usr/lib/arm-linux-gnueabihf/perl/5.32 /usr/share/perl/5.32 /usr/local/lib/site_perl) at -e line 1.
BEGIN failed--compilation aborted at -e line 1.


Das ist der Fehler !!

Auf Wheezy  findet er es in :


sudo ls -ld $(sudo perl -E'use DateTime::Format::Duration;@p=split"/",$INC{"DateTime/Format/Duration.pm"};say join"/",@p and pop@p while@p>1')
drwxr-xr-x 10 root root   4096 Okt 28  2012 /usr
drwxrwsr-x  9 root staff  4096 Mär  9  2019 /usr/local
drwxrwsr-x  9 root staff  4096 Dez 30  2017 /usr/local/share
drwxrwsr-x  3 root staff  4096 Dez 30  2017 /usr/local/share/perl
drwxrwsr-x  3 root staff  4096 Dez 30  2017 /usr/local/share/perl/5.14.2
drwxrwsr-x  3 root staff  4096 Dez 30  2017 /usr/local/share/perl/5.14.2/DateTime
drwxrwsr-x  2 root staff  4096 Dez 30  2017 /usr/local/share/perl/5.14.2/DateTime/Format
-r-xr-xr-x  1 root staff 35888 Sep 20  2015 /usr/local/share/perl/5.14.2/DateTime/Format/Duration.pm


Was ist jetzt das wirkliche Problem / Unterschied ?   
Muss man PERL anders installieren !    ---  Wieso habe ich auf Whezzy  dies unter  /usr/local/share ... ?


Bei bullseye  gibt es bei mir   unter  /use/local/share      ein "perl" und  "perl5" verzeichnis
aber nur unter  perl5  ein verzeichnis  DateTime/Format   aber darunter halt kein Duration

Muss ich das nach installieren ?   - von Wo  und wie  für Bullseye ?

auf weezy fined ich es unter :

/usr/lib/perl5/DateTime/Duration.pm
/usr/local/share/perl/5.14.2/DateTime/Format/Duration.pm

Und auf bullseye überhaupt nicht !   -weshalb



FHEM auf Debian (RASPI), 2 * CUL868/433 *&nbsp; FS20 STR, 2 * HMS100 T, 2 *&nbsp;, 1* FS20 SU, 2 *&nbsp; FS20 SM8, 2 ; 1-wire Temp,i2c Bus; ESP32 WROOM; ESP8266; Arduino
Sonnenbatterie Eco8;Elektro&nbsp; Nachspeicher-Ofen Ladesteuerung,
Haus Lüftung,
Integration von HardwareAlarmanlag