# Import GPIO library

**URL:** <https://forums.developer.nvidia.com/t/import-gpio-library/144398>\
**Category:** Jetson Nano\
**Tags:** gpio\
**Created:** [July 28, 2020, 11:01am UTC](https://forums.developer.nvidia.com/t/import-gpio-library/144398 "2020-07-28T11:01:35Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![\_Minary](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@\_Minary](https://forums.developer.nvidia.com/u/_Minary)\
**Post date:** [July 28, 2020, 11:01am UTC](https://forums.developer.nvidia.com/t/import-gpio-library/144398/1 "2020-07-28T11:01:35Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![JerryChang](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/jerrychang/32/14043_2.png) [@JerryChang](https://forums.developer.nvidia.com/u/JerryChang)\
**Post date:** [July 29, 2020, 2:21am UTC](https://forums.developer.nvidia.com/t/import-gpio-library/144398/3 "2020-07-29T02:21:18Z")

</div>

hello \_Minary,

1. you may refer to [Jetson-GPIO](https://github.com/NVIDIA/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](https://docs.nvidia.com/jetson/archives/l4t-archived/l4t-3243/index.html#page/Tegra%2520Linux%2520Driver%2520Package%2520Development%2520Guide%2Fhw_setup_jetson_io.html) to enable Jetson‑IO for configuration.  
thanks

---

<div class="post-metadata">

**Author:** ![\_Minary](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@\_Minary](https://forums.developer.nvidia.com/u/_Minary)\
**Post date:** [July 29, 2020, 4:41am UTC](https://forums.developer.nvidia.com/t/import-gpio-library/144398/4 "2020-07-29T04:41:48Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![\_Minary](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@\_Minary](https://forums.developer.nvidia.com/u/_Minary)\
**Post date:** [July 29, 2020, 8:19am UTC](https://forums.developer.nvidia.com/t/import-gpio-library/144398/5 "2020-07-29T08:19:45Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![\_Minary](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@\_Minary](https://forums.developer.nvidia.com/u/_Minary)\
**Post date:** [July 29, 2020, 12:15pm UTC](https://forums.developer.nvidia.com/t/import-gpio-library/144398/6 "2020-07-29T12:15:19Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![JerryChang](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/jerrychang/32/14043_2.png) [@JerryChang](https://forums.developer.nvidia.com/u/JerryChang)\
**Post date:** [July 30, 2020, 8:53am UTC](https://forums.developer.nvidia.com/t/import-gpio-library/144398/7 "2020-07-30T08:53:10Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![\_Minary](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@\_Minary](https://forums.developer.nvidia.com/u/_Minary)\
**Post date:** [August 7, 2020, 8:30am UTC](https://forums.developer.nvidia.com/t/import-gpio-library/144398/8 "2020-08-07T08:30:56Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![nadeemm](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/nadeemm/32/367020_2.png) [@nadeemm](https://forums.developer.nvidia.com/u/nadeemm)\
**Post date:** [October 18, 2021, 5:53pm UTC](https://forums.developer.nvidia.com/t/import-gpio-library/144398/10 "2021-10-18T17:53:16Z")

</div>


