ts1 / PiIR

IR remote control for Raspberry Pi
MIT License
33 stars 5 forks source link

API module not found #2

Closed DavHul closed 3 years ago

DavHul commented 3 years ago

Hi, I am using a Raspberry Pi Zero WH with the latest version of Raspbian. I installed the program and it runs fine in the cmd but not when I import it in a python script. I get a the error: ImportError: No module named piir although it is installed. I've tried uninstalling and reinstalling it but it still doesn't work. I have the exact same hardware configuration as shown in the README. I have the problem both with sending and receiving

Could you please help me?

ts1 commented 3 years ago

Hi! Are you using Python 3? This module supports Python 3.x only. If your script is running on Python 2.x (or just python, which would run Python 2.x) module won't be found.

ts1@home:~ $ python
Python 2.7.16 (default, Oct 10 2019, 22:02:15) 
[GCC 8.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import piir
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named piir
>>> 
ts1@home:~ $ python3
Python 3.7.3 (default, Jul 25 2020, 13:03:44) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import piir
>>> 
DavHul commented 3 years ago

Oh wow, it works now. Thanks for the help! I wouldn't have found the problem without you!