Support Forum

Share your projects and post your questions

Register   or   Sign In
The Forum

No Module found IOPi

2856 Views - Created 01/10/2018

01/10/2018

Posted by:
Industratech

Industratech 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

andrew Avatar

Location:
United Kingdom

andrew Twitter  andrew 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

02/10/2018

Posted by:
Industratech

Industratech Avatar

Thanks a mill let me try this and will revert.

02/10/2018

Posted by:
Industratech

Industratech Avatar

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

02/10/2018

Posted by:
andrew

andrew Avatar

Location:
United Kingdom

andrew Twitter  andrew 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.

02/10/2018

Posted by:
Industratech

Industratech 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

andrew Avatar

Location:
United Kingdom

andrew Twitter  andrew Website  

The IO Pi does need to be plugged into the board otherwise it will throw 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.

03/10/2018

Posted by:
Industratech

Industratech Avatar

Thanks for the assistance all working 100%

Sign in to post your reply

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.