LeMaker / RPi.GPIO_BP

This a modified version RPi.GPIO for Banana Pi
GNU General Public License v2.0
48 stars 41 forks source link

Works only in python 2.7? #11

Open DJManas opened 8 years ago

DJManas commented 8 years ago

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 commented 8 years ago

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 commented 4 years ago

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 !