range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
200
3.17. How to install and use wiringOP-Python
wiringOP-Python is the Python language version of wiringOP, which is used to
operate the hardware resources of the development board, such as GPIO, I2C, SPI
and UART, in the Python program.
In addition, please note that all the following commands are operated under the
root user.
3.17.1. wiringOP-Python installation method
1) First install the dependency package
root@orangepi:~# sudo apt-get update
root@orangepi:~# sudo apt-get -y install git swig python3-dev python3-setuptools
2) Then use the following command to download the source code of wiringOP-Python
Note that the following git clone--recursive command will automatically
download the source code of wiringOP, because wiringOP-Python depends on
wiringOP. Please make sure that the download process does not report an error due
to network problems。
If there is a problem with the download code from GitHub, you can use the
wiringOP-Python source code that comes with the Linux image directly, and the
storage location is:/usr/src/wiringOP-Python
root@orangepi:~# git clone --recursive https://github.com/orangepi-xunlong/wiringOP-Python -b next
root@orangepi:~# cd wiringOP-Python
root@orangepi:~/wiringOP-Python# git submodule update --init --remote
3) Then use the following command to compile wiringOP-Python and install it into the
Linux system of the development board
root@orangepi:~# cd wiringOP-Python
root@orangepi:~/wiringOP-Python# python3 generate-bindings.py > bindings.i
root@orangepi:~/wiringOP-Python# sudo python3 setup.py install