DzikuVx/piVirtualWire

Import Error

Closed this issue · 1 comments

ibwev commented

Thank you for your tutorial at [https://github.com/DzikuVx/piVirtualWire]. Unfortunately, I am not loading the module correctly on my Pi. I created a directory named "piVirtualWire" and placed an executable file into "piVirtualWire" file using the code from this site [https://github.com/DzikuVx/piVirtualWire/blob/master/piVirtualWire.py]

I placed the below code into a file I named recPi.py.

`import piVirtualWire.piVirtualWire as piVirtualWire
import time
import pigpio

if name == "main":

pi = pigpio.pi()
rx = piVirtualWire.rx(pi, 18, 1000) # Set pigpio instance, TX module GPIO pin and baud rate

while True:

        while rx.ready():
            print(rx.get())

        time.sleep(0.5)

rx.cancel()
pi.stop()`

I am receiving the error message in the attached pic. Please help me understand why I am getting an import error.

image

ibwev commented

I did not execute my receive program correctly. I should have typed "./recPi.py" in directory where program is located. Instead, I typed "python ~/PIGPIO/recPi.py".