Jetson.GPIO not working on Python inside the container

I am trying the GPIO library on Python, it works perfectly fine oustside the container, however, when it comes to run the container and then the python file, it just won’t recognize the library, I have downloaded the Jetson.GPIO from both github (manually) and with “pip install” gave the permissions and added to the user group, but still, it seems not to work, I will attach a picture of the error.

Hi,

We can install Jetson.GPIO as below:

$ sudo docker run -it --rm --net=host --runtime nvidia -e DISPLAY=$DISPLAY -v /tmp/.X11-unix/:/tmp/.X11-unix nvcr.io/nvidia/l4t-base:r32.5.0
$ apt-get update
$ apt-get install python3-pip
$ pip3 install Jetson.GPIO

We are checking the permission issue internally.
Will share more information with you late.

Below is a related discussion for your reference:

Thanks.

1 Like

Thanks for that, however it still does not work, I have done what you said and followed what the other link of the forum was suggesting, but it still gives me problems.

Hi,

Please try below customized Jetson.GPIO for Nano.
https://github.com/Heerpa/jetson-gpio-nanohard

$ sudo docker run -it --rm --net=host --runtime nvidia -e DISPLAY=$DISPLAY -v /tmp/.X11-unix/:/tmp/.X11-unix -v /etc/udev/rules.d:/etc/udev/rules.d -v /dev:/dev -v /sys/class/gpio:/sys/class/gpio -v /sys/devices:/sys/devices -v /dev/gpiochip0:/dev/gpiochip0 -v /dev/gpiochip1:/dev/gpiochip1 nvcr.io/nvidia/l4t-base:r32.5.0
$ apt-get update && apt-get install python3-pip git
$ git clone https://github.com/Heerpa/jetson-gpio-nanohard.git
$ cd jetson-gpio-nanohard/
$ python3 setup.py install
# python3
Python 3.6.9 (default, Jan 26 2021, 15:33:00)
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import Jetson.GPIO as GPIO
WARNING: Hard coded to use board Jetson Nano r200.
WARNNIG: Make sure this is the board you are using
WARNING: Otherwise it is unlikely to work correctly.
>>>

Thanks.