0

I use NanoPi NEO Air Version: Linux version 4.19.20-sunxi (root@armbian.com) (gcc version 7.2.1 20171011 (Linaro GCC 7.2-2017.11)) and when I try to import this lib in my code I have an import error.

root@PC_22:# sudo apt-get install python-dev
Reading package lists Done
Building dependency tree
Reading state information Done
python-dev is already the newest version (2.7.13-2).
0 upgraded, 0 newly installed, 0 to remove and 130 not upgraded.
root@PC_22:/RPi.GPIO_NP# sudo python setup.py install
running install
running build
running build_py
running build_ext
running install_lib
running install_egg_info
Removing /usr/local/lib/python2.7/dist-packages/RPi.GPIO-0.5.8.egg-info
Writing /usr/local/lib/python2.7/dist-packages/RPi.GPIO-0.5.8.egg-info
root@PC_22:~/RPi.GPIO_NP# python
Python 2.7.13 (default, Apr 16 2021, 14:02:03)
[GCC 6.3.0 20170516] on linux2
Type "help", "copyright", "credits" or "license" for more information.

#!/usr/bin/env python
 import RPi.GPIO as GPIO
Traceback (most recent call last):
File "", line 2, in
ImportError: No module named GPIO

After running pip install --user RPi.GPIO it shows an error message that this lib can be used only on a Raspberry Pi.

karel
  • 5,489
  • 46
  • 45
  • 50
  • did you check documentation how to use it? Maybe it doesn't have `RPi.GPIO` but `RPi.gpio` or something different. – furas Sep 28 '21 at 15:10
  • [this page](https://github.com/friendlyarm/RPi.GPIO_NP) has information that you have to use both `python setup.py install` and `sudo python setup.py install` to create it correctly. - but I don't see `python setup.py install` in your code - maybe this is your problem. – furas Sep 28 '21 at 15:13
  • Yes i read documentation and copy from there. And i use python setup.py install – MelioraHS Sep 29 '21 at 16:22

0 Answers0