Ankündigung

Einklappen
Keine Ankündigung bisher.

module' object has no attribute 'getloadavg'

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

    module' object has no attribute 'getloadavg'

    Hallo Zusammen,

    ich habe mir mal eibd und smartvisu auf meinen zyxel nas (nsa325) installiert.
    eibd läuft auch ohne probleme, wird automatisch beim hochfahren des nas gestartet.

    wenn ich nun smarthome.py starte erscheint im log folgende fehlermeldung:

    Code:
    Init SmartHome.py 1.0-25-g921ba82
     INFO     Main         Start SmartHome.py 1.0-25-g921ba82
     WARNING  Main         Could not find/use ephem!
     WARNING  Main         Could not find/use ephem!
     INFO     Main         Init Scheduler
     INFO     Main         Init Plugins
     INFO     Main         Init Items
     INFO     Main         Start Plugins
     INFO     Main         Start Logics
     WARNING  Main         MyLogic: Could not access logic file (/e-data/b6fc4d71-db45-4c3c-a9b9-3a1edd977cbb/ffproot/ffp/usr/local/smarthome/logics/logic.py) => ignoring.
     ERROR    env_loc      Logic: env_loc, File: /e-data/b6fc4d71-db45-4c3c-a9b9-3a1edd977cbb/ffproot/ffp/usr/local/smarthome/lib/orb.py, Line: 60, Method: rise, Exception: 'Orb' object has no attribute '_obs'
    Traceback (most recent call last):
      File "/e-data/b6fc4d71-db45-4c3c-a9b9-3a1edd977cbb/ffproot/ffp/usr/local/smarthome/lib/scheduler.py", line 327, in _task
        exec(obj.bytecode)
      File "/e-data/b6fc4d71-db45-4c3c-a9b9-3a1edd977cbb/ffproot/ffp/usr/local/smarthome/lib/env/location.py", line 5, in <module>
        sh.env.location.sunrise(sh.sun.rise().astimezone(sh.tzinfo()))
      File "/e-data/b6fc4d71-db45-4c3c-a9b9-3a1edd977cbb/ffproot/ffp/usr/local/smarthome/lib/orb.py", line 60, in rise
        self._obs.date = datetime.datetime.utcnow() - dateutil.relativedelta.relativedelta(minutes=moff) + dateutil.relativedelta.relativedelta(seconds=2)
    AttributeError: 'Orb' object has no attribute '_obs'
     ERROR    Scheduler    Error parsing crontab: sunset-7
     ERROR    Scheduler    Error parsing crontab: sunrise+1m
     ERROR    Scheduler    Error parsing crontab: sunrise-5
     ERROR    Scheduler    Error parsing crontab: sunset+1m
     ERROR    Scheduler    Error parsing crontab: 4 2 * *
     ERROR    env_stat     Logic: env_stat, File: /e-data/b6fc4d71-db45-4c3c-a9b9-3a1edd977cbb/ffproot/ffp/usr/local/smarthome/lib/env/stat.py, Line: 29, Method: <module>, Exception: 'module' object has no attribute 'getloadavg'
    Traceback (most recent call last):
      File "/e-data/b6fc4d71-db45-4c3c-a9b9-3a1edd977cbb/ffproot/ffp/usr/local/smarthome/lib/scheduler.py", line 327, in _task
        exec(obj.bytecode)
      File "/e-data/b6fc4d71-db45-4c3c-a9b9-3a1edd977cbb/ffproot/ffp/usr/local/smarthome/lib/env/stat.py", line 29, in <module>
        l1, l5, l15 = os.getloadavg()
    AttributeError: 'module' object has no attribute 'getloadavg'
    kann mir jemand weiterhelfen ?

    gruß christian


    Update 1
    Habe jetzt noch ephem installiert. Problem mit der stat.py bleibt bestehen. getestet mit version 1.0 sowie der aktuell git version

    #2
    Hallo Zusammen,

    hier jetzt nochmals das Logfile. Es läuft zwar und funktioniert auch im Zusammenspiel mit Smartvisu aber Error´s sollte man eig. beseitigen.

    Code:
     INFO     Main         Start SmartHome.py 1.0-25-g921ba82
     INFO     Main         Init Scheduler
     INFO     Main         Init Plugins
     INFO     Main         Init Items
     INFO     Main         Start Plugins
     ERROR    visu         Could not find header file: /ffp/www/smartvisu/tpl/header.html
     INFO     Main         Start Logics
     WARNING  Main         MyLogic: Could not access logic file (/e-data/b6fc4d71-db45-4c3c-a9b9-3a1edd977cbb/ffproot/ffp/usr/local/smarthome/logics/logic.py) => ignoring.
     ERROR    Scheduler    Error parsing crontab: 4 2 * *
     ERROR    env_stat     Logic: env_stat, File: /e-data/b6fc4d71-db45-4c3c-a9b9-3a1edd977cbb/ffproot/ffp/usr/local/smarthome/lib/env/stat.py, Line: 29, Method: <module>, Exception: 'module' object has no attribute 'getloadavg'
    Traceback (most recent call last):
      File "/e-data/b6fc4d71-db45-4c3c-a9b9-3a1edd977cbb/ffproot/ffp/usr/local/smarthome/lib/scheduler.py", line 327, in _task
        exec(obj.bytecode)
      File "/e-data/b6fc4d71-db45-4c3c-a9b9-3a1edd977cbb/ffproot/ffp/usr/local/smarthome/lib/env/stat.py", line 29, in <module>
        l1, l5, l15 = os.getloadavg()
    AttributeError: 'module' object has no attribute 'getloadavg'
    und nun noch zu etwas anderem.
    Ich habe mir eine Items.conf angelegt und mal sh.py neu gestartet. Jedoch wird nur eine leere html Seite erzeugt. Keine index.html, keine navigation.html

    Code:
    ['eg']
        [['wohnzimmer']]
            name = Wohnzimmer
            sv_page = room
            sv_img = scene_living.png
            [[[light]]]
                name = Light
                type = bool
                visu = yes
                sv_widget = {{ basic.switch('item', 'item') }}
                knx_dpt = 1
                knx_listen = 0/0/10
                knx_send = 0/0/10

    Kommentar


      #3
      Hi Christian,

      zu wenig Information um Dir zu helfen. Siehe Checkliste...

      Bis bald

      Marcus

      Kommentar


        #4
        Hallo Marcus,

        ich konnte das Problem nun selbst lokalisieren. Es liegt einfach daran, dass Python 3 bei der Installation auf meinem NAS diese Funktion nicht supportet.

        ich habe nun einfach das Script abgeändert. Für alle die es interessiert:
        #lib/env/stat.py

        Code:
        l1, l5, l15 = os.getloadavg()
            sh.env.system.load(round(l5, 2))
        abändern in:

        Code:
        if "loadavg" in dir(os) == True:
            sh.env.system.load(round(0, 2))
        else:
            l1, l5, l15 = os.getloadavg()
            sh.env.system.load(round(l5, 2))
        Leider folgt nun auch gleich das nächste Problem.
        Habe schon alle Zeichensätze durch. UTF-8, Ansi, Latin1
        Auch mit dem Notepad++ schon probiert.

        Code:
          File "/e-data/b6fc4d71-db45-4c3c-a9b9-3a1edd977cbb/ffproot/ffp/usr/local/smarthome/plugins/visu/smartvisu.py", line 112, in pages
            f.write(r)
        UnicodeEncodeError: 'ascii' codec can't encode character '\xdf' in position 135: ordinal not in range(128)
        hier die Items:

        Code:
        [eg]
            [[wohnzimmer]]
            name = wohnzimmer
            sv_page = room
            [[[light]]]
                name = Light
                type = bool
                visu = yes
                knx_listen = 0/0/10
                knx_send = 0/0/10

        Kommentar


          #5
          Hi Christian,

          das Problem hat ziemlich sicher nichts mit dem Item zu tun. Aber auch hier gilt wieder einmal, ohne Informationen insb. komplettes Debuglog kann ich nicht helfen.

          Bis bald

          Marcus

          Kommentar

          Lädt...
          X