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

Maybe wrong target dir? #6

Open
motom001 opened this issue Feb 15, 2015 · 7 comments
Open

Maybe wrong target dir? #6

motom001 opened this issue Feb 15, 2015 · 7 comments

Comments

@motom001
Copy link

I use bananian and follow the install instructions.

1st: apt-get install gcc is missing
2nd: there is no sudo for bananian

The setup install to /usr/local/lib/python2.7/dist-packages but all other packages are located under /usr/lib/python2.7/dist-packages

@motom001
Copy link
Author

Install-Log:

root@bananapipro ~/tmp/RPi.GPIO_BP (git)-[bananapro] # python setup.py install
running install
running build
running build_py
running build_ext
building 'RPi.GPIO' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c source/py_gpio.c -o build/temp.linux-armv7l-2.7/source/py_gpio.o
source/py_gpio.c: In function ‘py_setup_channel’:
source/py_gpio.c:130:8: warning: variable ‘func’ set but not used [-Wunused-but-set-variable]
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c source/c_gpio.c -o build/temp.linux-armv7l-2.7/source/c_gpio.o
source/c_gpio.c: In function ‘setup’:
source/c_gpio.c:73:3: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration]
source/c_gpio.c:73:3: warning: incompatible implicit declaration of built-in function ‘printf’ [enabled by default]
source/c_gpio.c:73:3: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 2 has type ‘uint8_t *’ [-Wformat]
source/c_gpio.c:73:3: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 3 has type ‘volatile uint32_t *’ [-Wformat]
source/c_gpio.c: In function ‘readl’:
source/c_gpio.c:89:3: warning: incompatible implicit declaration of built-in function ‘printf’ [enabled by default]
source/c_gpio.c:89:3: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type ‘volatile uint32_t *’ [-Wformat]
source/c_gpio.c:89:3: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 5 has type ‘volatile uint32_t *’ [-Wformat]
source/c_gpio.c: In function ‘set_pullupdn’:
source/c_gpio.c:161:3: warning: incompatible implicit declaration of built-in function ‘printf’ [enabled by default]
source/c_gpio.c: In function ‘setup_gpio’:
source/c_gpio.c:185:3: warning: incompatible implicit declaration of built-in function ‘printf’ [enabled by default]
source/c_gpio.c: In function ‘gpio_function’:
source/c_gpio.c:230:3: warning: incompatible implicit declaration of built-in function ‘printf’ [enabled by default]
source/c_gpio.c: In function ‘output_gpio’:
source/c_gpio.c:248:3: warning: incompatible implicit declaration of built-in function ‘printf’ [enabled by default]
source/c_gpio.c: In function ‘input_gpio’:
source/c_gpio.c:279:3: warning: incompatible implicit declaration of built-in function ‘printf’ [enabled by default]
source/c_gpio.c: In function ‘eventdetected’:
source/c_gpio.c:116:1: warning: control reaches end of non-void function [-Wreturn-type]
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c source/cpuinfo.c -o build/temp.linux-armv7l-2.7/source/cpuinfo.o
source/cpuinfo.c: In function ‘get_rpi_revision’:
source/cpuinfo.c:67:1: warning: control reaches end of non-void function [-Wreturn-type]
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c source/event_gpio.c -o build/temp.linux-armv7l-2.7/source/event_gpio.o
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c source/soft_pwm.c -o build/temp.linux-armv7l-2.7/source/soft_pwm.o
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c source/py_pwm.c -o build/temp.linux-armv7l-2.7/source/py_pwm.o
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c source/common.c -o build/temp.linux-armv7l-2.7/source/common.o
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c source/constants.c -o build/temp.linux-armv7l-2.7/source/constants.o
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro build/temp.linux-armv7l-2.7/source/py_gpio.o build/temp.linux-armv7l-2.7/source/c_gpio.o build/temp.linux-armv7l-2.7/source/cpuinfo.o build/temp.linux-armv7l-2.7/source/event_gpio.o build/temp.linux-armv7l-2.7/source/soft_pwm.o build/temp.linux-armv7l-2.7/source/py_pwm.o build/temp.linux-armv7l-2.7/source/common.o build/temp.linux-armv7l-2.7/source/constants.o -o build/lib.linux-armv7l-2.7/RPi/GPIO.so
running install_lib
creating /usr/local/lib/python2.7/dist-packages/RPi
copying build/lib.linux-armv7l-2.7/RPi/__init__.py -> /usr/local/lib/python2.7/dist-packages/RPi
copying build/lib.linux-armv7l-2.7/RPi/GPIO.so -> /usr/local/lib/python2.7/dist-packages/RPi
byte-compiling /usr/local/lib/python2.7/dist-packages/RPi/__init__.py to __init__.pyc
running install_egg_info
Writing /usr/local/lib/python2.7/dist-packages/RPi.GPIO-0.5.8.egg-info
python setup.py install  6,30s user 0,73s system 96% cpu 7,248 total

@motom001
Copy link
Author

Python Error:

root@bananapipro ~/tmp/RPi.GPIO_BP (git)-[bananapro] # python2
Python 2.7.3 (default, Mar 14 2014, 17:55:54)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import RPi.GPIO as GPIO
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named GPIO
>>>

@motom001
Copy link
Author

Python Error also for RPi.GPIO_BP

root@bananapipro ~/tmp/RPi.GPIO_BP (git)-[bananapro] # python2
Python 2.7.3 (default, Mar 14 2014, 17:55:54)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import RPi.GPIO_BP
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named GPIO_BP
>>>

@Stemby
Copy link

Stemby commented Mar 20, 2015

@motom001:
I compiled the module for Python 3, but that should be the same:

# python3
Python 3.2.3 (default, Feb 20 2013, 22:32:37) 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import RPi.GPIO as GPIO
BAPI: revision(1)
>>> 

Module's name is RPi.GPIO (without _BP).

I hope this can help you.

Ciao!

@maxpavlov
Copy link

I have the same problem. Using correct "import RPi.GPIO as GPIO" still produces the above mentioned error on bananian.

@PA0MHE
Copy link

PA0MHE commented Nov 27, 2015

I have the same problem as motom001, only I'm using a bananapi (not the pro)
Is it possible to manually move the files to the other directory ?? Or do I need to do more ?

paramono added a commit to paramono/RPi.GPIO_BP that referenced this issue Oct 15, 2016
This update has been made in response to the following issue: LeMaker#6
@paramono
Copy link

Make sure the module is installed by running:

pip freeze  # substitute pip for pip3 if necessary

If it is, then check your current working directory (pwd). If you're still inside the RPi.GPIO_BP source directory, cd somewhere else, and run python from there - the error should disappear.

I created a pull request where I updated readme file with this information. Hope it helps.

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

5 participants