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

Works only in python 2.7? #11

Open
DJManas opened this issue Feb 20, 2016 · 2 comments
Open

Works only in python 2.7? #11

DJManas opened this issue Feb 20, 2016 · 2 comments

Comments

@DJManas
Copy link

DJManas commented Feb 20, 2016

This works only in python 2.7?

In 3.4 I get:
>>> import RPi.GPIO Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named 'RPi'

@cprima
Copy link

cprima commented Feb 26, 2016

I got it to work today in Python3 without problems, here is what I did:

$ python   
Python 3.5.1 (default, Dec 11 2015, 05:35:45) 
[GCC 5.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import RPi.GPIO as GPIO
BAPI: revision(2)
>>> 

This was after:

git clone https://github.com/LeMaker/RPi.GPIO_BP -b bananapro
$ cd RPi.GPIO_BP
python3.5 setup.py install
sudo python3.5 setup.py install
exit

Then I logged back in and checked with ls /usr/lib/python3.5/site-packages/RPi/ and there is indeed a GPIO.*so in there.

@Akwariom
Copy link

Akwariom commented Jun 5, 2020

Very old post , but could not find a solution. I managed to install the library as easilly under Python3.8 as I did under Python2.7. (following above instructions). Using a BananaPi M2+. The most basic of codes (read an input an print the result), works fine under 2.7 and not under 3.8. It only reads "0". Any idea? Thanks much !

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

3 participants