raspberry-strogonanoff icon indicating copy to clipboard operation
raspberry-strogonanoff copied to clipboard

no module named wiringpi

Open mustaphamillion opened this issue 10 years ago • 4 comments

Hi there,

I have been having the same problems as someone else, where running the code: sudo ./strogonanoff_sender.py --channel 1 --button 4 --gpio 0 on

gives the following error: Traceback (most recent call last): File "./strogonanoff_sender.py", line 62, in from WiringPin import WiringPin File "/home/pi/git/raspberry-strogonanoff/src/WiringPin.py", line 1, in import wiringpi File "/home/pi/git/raspberry-strogonanoff/src/wiringpi.py", line 26, in _wiringpi = swig_import_helper() File "/home/pi/git/raspberry-strogonanoff/src/wiringpi.py", line 18, in swig_import_helper import _wiringpi ImportError: No module named _wiringpi

  • I tried to reach the site with their fix but it is no longer there. I have followed your instructions: python -c 'import sys; print sys.path' and had the following results: python -c 'import sys; print sys.path' ['', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-linux2', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/pymodules/python2.7']

I have moved every file into every possible place, but to no avail. I would really appreciate your help on this one; I MUST turn the lights on..!

Thanks,

Dan

mustaphamillion avatar Jun 17 '15 13:06 mustaphamillion

Hi - if you can point me at the thread you came here from I can have a look.

I'm not close to a Pi this week, but may be able to port to WiringPi2 next week.

dmcg avatar Jun 17 '15 21:06 dmcg

Hi there Duncan,

here is the link for where I came from:

https://github.com/dmcg/raspberry-strogonanoff/issues/6

no rush!

Thanks

Dan

On 17 June 2015 at 22:28, Duncan McGregor [email protected] wrote:

Hi - if you can point me at the thread you came here from I can have a look.

I'm not close to a Pi this week, but may be able to port to WiringPi2 next week.

— Reply to this email directly or view it on GitHub https://github.com/dmcg/raspberry-strogonanoff/issues/8#issuecomment-112954486 .

Best regards,

Dan Allton

e-mail: [email protected] e-mail: [email protected] mobile: 07403 279 160

mustaphamillion avatar Jun 18 '15 08:06 mustaphamillion

So I've just reinstalled both strogonanoff and WiringPi from the original instructions and it works for me.

But...

this is on my 2013 vintage Raspbian - $ uname -a Linux raspberrypi 3.6.11+ #538 PREEMPT Fri Aug 30 20:42:08 BST 2013 armv6l GNU/Linux

When I run $ python -c 'import sys; print sys.path' ['', '/usr/local/lib/python2.7/dist-packages/setuptools-1.4-py2.7.egg', '/usr/local/lib/python2.7/dist-packages/wiringpi2-1.0.10-py2.7-linux-armv6l.egg', '/usr/local/lib/python2.7/dist-packages/wiringpi-1.1.0-py2.7-linux-armv6l.egg', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-linux2', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/pymodules/python2.7']

so I suspect that later versions have moved Python to /usr/lib/python2.7 rather than /usr/local/lib/python2.7 that the WiringPi installer expects. Also it looks like I have installed WiringPi2 at some point

Do you have a directory

/usr/local/lib/python2.7/dist-packages/wiringpi-1.1.0-py2.7-linux-armv6l.egg

If so you could try moving it to /usr/lib/python2.7/dist-packages

In the meantime I'll try to dig out another SD card to install a newer Raspbian

dmcg avatar Jul 15 '15 20:07 dmcg

So with an OS upgrade it still works fine here. I suspect that WiringPi simply hasn't been installed.

dmcg avatar Jul 17 '15 07:07 dmcg