Ankündigung

Einklappen
Keine Ankündigung bisher.

Problem beim Debugging mit PyCharm und SmarthomeNG

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

    Problem beim Debugging mit PyCharm und SmarthomeNG

    Hallo Zusammen,

    nachdem mein altes Smarthome nun schon einige Jahre stabil läuft, habe ich mich mal an SmartHomeNG gewagt.
    Als Grundlage habe ich das Image von Onkelandy in Version 1.3 genommen, vielen Dank an Ihn.
    Zum Einrichen von PyCharm habe ich mich an die Anleitung
    https://github.com/smarthomeNG/smart...nd-SmartHomeNG
    gehalten.
    Die /etc/profile.d/smarthome.sh war nicht vorhanden, also habe ich eine neue erstellt und
    export PYTHONPATH="/usr/lib/python3/dist-packages/pycharm-debug-py3k.egg"
    eingetragen.
    DasPyCarm-Debugger-Package habe ich in die init.py eingetragen:
    import pydevd

    Beim Start von Smarthome bekomme ich im Log nun folgende Fehlermeldung:
    Logic: env_init, File: /usr/local/smarthome/lib/env/init.py, Line: 5, Method: <module>, Exception: No module named 'pydevd'
    Traceback (most recent call last):
    File "/usr/local/smarthome/lib/scheduler.py", line 355, in _task
    exec(obj.bytecode)
    File "/usr/local/smarthome/lib/env/init.py", line 5, in <module>
    import pydevd
    ImportError: No module named 'pydevd'
    Das bedeutet doch, dass Python die pycharm-debug-py3k.egg nicht findet und somit auch das Modul nicht laden kann.

    Hat jemand ein Tipp was ich evtl. falsch gemacht habe?

    Nachtrag:
    Habe die smarthome.sh wieder gelöscht und den export... direkt in der '/etc/profile' eingetragen.
    Wenn ich jetzt direkt auf der shell python3 aufrufe und import pydevd eingebe, findet Python das Modul - keine Fehlermeldung.

    smarthome@sh_jessie:~$ python3
    Python 3.5.2 (default, Aug 15 2016, 22:13:31)
    [GCC 4.9.2] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import pydevd
    >>> import sys
    >>> sys.path
    ['', '/usr/lib/python3/dist-packages/pycharm-debug-py3k.egg', '/usr/local/lib/python35.zip', '/usr/local/lib/python3.5', '/usr/local/lib/python3.5/plat-linux', '/usr/local/lib/python3.5/lib-dynload', '/usr/local/lib/python3.5/site-packages']
    >>>
    Aber:
    Die Fehlermeldung im log von smarthome bleibt
    Zuletzt geändert von ElektroRudi; 07.12.2016, 17:17.
    Gruß
    ElektroRudi

    ............kann,.muß aber net....

    #2
    Es gibt einen Unterschied ob smarthome vom System gestartet wird oder ob man es von der shell aus stoppt und wieder startet.
    Wenn ich smarthome über
    python /usr/local/smarthome/bin/smarthome.py --start
    starte ist der Pfad zu pydevd bekannt und das Debugging funktioniert einwandfrei.
    Wenn ich aber smarthome über
    sudo systemctl start smarthome.service
    starte ist der Pfad zu pydevd nicht bekannt und es kommt zu der beschriebenen Fehlermeldung.

    Wenn mir das einer erklären kann bin ich dankbar.
    So kann ich aber arbeiten und das DWD-Plugin an meine Bedürfnisse anpassen.
    Gruß
    ElektroRudi

    ............kann,.muß aber net....

    Kommentar

    Lädt...
    X