About Us Knowledge Base Community Forum Electronics Toolbox FAQ Shipping & Delivery

Community Forum

Share your projects and post your questions

Search
Register or Sign In
Forum

No Module found IOPi

1313 Views - Created 01/10/2018

01/10/2018

Posted by:
Industratech

Users Avatar

Hi 

After the statement 

from IOPi import IOPi

I get an error no module named IOPi 

I have run the 

sudo apt-get install python-smbus 

which said it was already installed and updated. 

Anything I am missing?

 

01/10/2018

Posted by:
andrew

Users Avatar

Location:
United Kingdom

Users Twitter  Users Website  

Hi

It looks like your program is having trouble finding the IOPi.py library file. 

You need to either put the IOPi.py file in the same directory as your python program or install the library into the python library folders using the instructions on https://github.com/abelectronicsuk/ABElectronics_Python_Libraries/tree/master/IOPi 

AB Electronics UK Tech Support

02/10/2018

Posted by:
Industratech

Users Avatar

Thanks a mill let me try this and will revert.

02/10/2018

Posted by:
Industratech

Users Avatar

Where is the IOPi.py file usually kept on a standard sudo install?

02/10/2018

Posted by:
andrew

Users Avatar

Location:
United Kingdom

Users Twitter  Users Website  

For Python 2.7 the files will normally be installed in /usr/local/lib/python2.7/dist-packages/IOPi

For Python 3 the files will be installed in /usr/local/lib/python3.4/dist-packages/IOPi or /usr/local/lib/python3.5/dist-packages/IOPi depending on which version of Python 3 is installed.

AB Electronics UK Tech Support

02/10/2018

Posted by:
Industratech

Users Avatar

Ok the modules were not installed for some reason even though the sudo install stated they were. I downloaded with pip direct from github and now the folder is present in python 2.7 

The IOPi when initialized in your program requires the IOPi expansion board plugged in as the I2C needs received data correct? As running the protocol without the board connected kick up a :

ioerror errno 5 input/output error

02/10/2018

Posted by:
andrew

Users Avatar

Location:
United Kingdom

Users Twitter  Users Website  

The IO Pi does need to be plugged into the board otherwise it will thrown an input/output error.

If you still get the error with the IO Pi installed then you will need to go through our I2C tutorial to make sure the I2C bus is installed and configured correctly.

AB Electronics UK Tech Support

03/10/2018

Posted by:
Industratech

Users Avatar

Thanks for the assistance all working 100%

Note: documents in Portable Document Format (PDF) require Adobe Acrobat Reader 5.0 or higher to view, download Adobe Acrobat Reader or other PDF reading software for your computer or mobile device.