tgalal / yowsup

The WhatsApp lib
GNU General Public License v3.0
7.08k stars 2.23k forks source link

can't get echoclient working - ValueError: Attempted relative import in non-package (.layer) #1837

Closed athol-de closed 5 years ago

athol-de commented 7 years ago

Hi, I try to get yowsup running on my RPi B (Raspbian Jessie light) to communicate with my home automation. I got the command line client working (incl. sending and receiving messages), so in principle yowsup works. Now I try to use the echoclient (or sendclient) demo to integrate yowsup into my own Python scripts and get this error message:

$ sudo python stack.py
Traceback (most recent call last):
  File "stack.py", line 2, in <module>
    from .layer import EchoLayer
ValueError: Attempted relative import in non-package

(It's the same with the sendclient, there it's "... import SendLayer").

Any idea what went wrong with me? I'm a bloody rookie concerning Unix, please have some patience with me. BTW: very cool project, thank you very much!

mapsiva commented 7 years ago

What's the file name of the EchoLayer class? Is it layer.py?

athol-de commented 7 years ago

Yes, it is. I'm talking about these files: https://github.com/tgalal/yowsup/tree/master/yowsup/demos/echoclient https://github.com/tgalal/yowsup/tree/master/yowsup/demos/sendclient The error is the same, referencing EchoLayer resp. SendLayer.