Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Cannot import in Python 3.4 #33
Currently the import fails with the following error message:
This is what I see having built from the GitHub source using SWIG3.0 on a Pi Zero running Raspbian Jessie:
Have you tried:
It looks like the package version you're running is ancient, it should read:
Good news first: I have now successfully imported wiringpi2 under Python 3 :-)
However, I am very confused regarding the difference between WiringPi-Python and WiringPi2-Python, I think I might have accidentally installed WiringPi2-Python which is properly the reason you noticed the ancient version. I thus tried to install WiringPi-Python which seems to me to be the non-deprecated one, however, I was unable to follow the install instructions. The swig-command gives me the following error:
And trying to install anyway immediately fails:
So, I went to pip which actually worked. However, as from you suggestion I used the command
However, in the end it actually works and I am happy :-)
For completeness I should mention this was tested on Debian 8, Jessie.
It's a little confusing at the moment. "WiringPi2-Python" has now been renamed to "WiringPi-Python" on GitHub, but is still called "WiringPi2" on PIP. You have correctly installed the latest and greatest version, but reminded me that I really need to tidy that up!
As it turned out its a simple spelling mistake in the instruction: instead of -thread it should be -threads.