Import GPIO library

Hello!

Could you help me to start test GPIO app on Python?

I’am install Pip, Jetson.GPIO, and PyCharm on Ubuntu and then try to start app, but had next error “ModuleNotFoundError: No module named ‘Jetson’” on this line “import Jetson.GPIO as GPIO”.

I’am check Python installation with this commands:
python --version and got result - Python 3.6.10
And after library install, i check this :pip search Jetson
and got:
Jetson.GPIO (2.0.8) - A module to control Jetson GPIO channels
INSTALLED: 2.0.8 (latest)

then i’am call this commands

sudo groupadd -f -r gpio
sudo usermod -a -G gpio m.gladyshev
sudo cp /usr/lib/python3.6/site-packages/Jetson/GPIO/99-gpio.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules && sudo udevadm trigger

What i’am doing wrong?

hello _Minary,

  1. you may refer to Jetson-GPIO, it’s a python library that enables the use of Jetson’s GPIOs;
  2. please also check the developer guide, Configuring the 40-Pin Expansion Header to enable Jetson‑IO for configuration.
    thanks

Hello, Jerry.
As I understand, i’am following steps in library installation readme, but dont have result.
Maybe I can check installation status of components with some commands?

My problem is in settings of Python Interpreter. In PyChar Settings must to choose installed Interpreter with all libraries (In my case /usr/bin/python3.6)

New problemm in this topic:)

After run program via konsole or PyCharm, there is no error in import Jetson.GPIO command, but got this:

Traceback (most recent call last):
File “/home/m.gladyshev/PycharmProjects/JetsonNano/Test_all_pins.py”, line 26, in
import RPi.GPIO as GPIO
File “/usr/lib/python3.6/site-packages/RPi/GPIO/init.py”, line 1, in
from Jetson.GPIO import *
File “/usr/lib/python3.6/site-packages/Jetson/GPIO/init.py”, line 1, in
from .gpio import *
File “/usr/lib/python3.6/site-packages/Jetson/GPIO/gpio.py”, line 70, in
model, JETSON_INFO, _channel_data_by_mode = gpio_pin_data.get_data()
File “/usr/lib/python3.6/site-packages/Jetson/GPIO/gpio_pin_data.py”, line 284, in get_data
with open(compatible_path, ‘r’) as f:
FileNotFoundError: [Errno 2] No such file or directory: ‘/proc/device-tree/compatible’

Could anybody help me?

hello _Minary,

may I know which JetPack release version you’re working with?
are you using default JetPack release image or you’d already done some customization.
thanks

Hello, Jerry.
I’am try tu run it on OpenSuse linux and this is my main problem. After installation original Nvidea image on Jetson, the library works well.