Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no module named wiringpi #8

Open
mustaphamillion opened this issue Jun 17, 2015 · 4 comments
Open

no module named wiringpi #8

mustaphamillion opened this issue Jun 17, 2015 · 4 comments

Comments

@mustaphamillion
Copy link

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

@dmcg
Copy link
Owner

dmcg commented Jun 17, 2015

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.

@mustaphamillion
Copy link
Author

Hi there Duncan,

here is the link for where I came from:

#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
#8 (comment)
.

Best regards,

Dan Allton

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

@dmcg
Copy link
Owner

dmcg commented Jul 15, 2015

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
Copy link
Owner

dmcg commented Jul 17, 2015

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants