DESK-MX6UL-AN-0004: Using Python for Embedded applications

From DAVE Developer's Wiki
Jump to: navigation, search
Info Box


200px-Emblem-important.svg.png

This application note has been validated using the kit version in the History table.


History
Issue Date Notes

2021/10/13

DESK-MX6UL-L 1.0.1
2022/01/21 DESK-MX6UL-L 3.0.0


Introduction[edit | edit source]

As found on Python official website, Python is a programming language that lets you work more quickly and integrate your systems more effectively and also Python can be easy to pick up whether you're a first-time programmer or you're experienced with other languages.

These sentences got a real confirmation if you have a look at the IEEE Top Programming Languages 2021 ranking. As you can see in the following picture Python reached the Top of the ranking even more than the native C language used since the beginning in Embedded systems programming:


IEEE Top programming languages 2021 - Embedded


As reported in this article The C/C++ programming languages dominate embedded systems programming, though they have a number of disadvantages. Python, on the other hand, has many strengths that make it a great language for embedded systems.

This application note provides some examples of software packages installation that can be used for building an Industrial IoT Gateway adding python3 libraries to the SBC Lynx platform.

Python on DESK[edit | edit source]

python3 application is already present on DESK-MX6UL-L dave-image-devel root file system.

Installing python packages[edit | edit source]

First of all check for the default installed python/pip version in the DESK-MX6UL root file system:

root@desk-mx6ul-lynx:~# python3 --version
Python 3.9.4
root@desk-mx6ul-lynx:~# 

pip3 is not present - by default - on standard root file system, but can be easily installed using python:

root@desk-mx6ul-lynx:~# curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0:00:01 --:--:-- 1846k
root@desk-mx6ul-lynx:~# python3 get-pip.py 
Collecting pip
  Downloading pip-21.3.1-py3-none-any.whl (1.7 MB)
     |################| 1.7 MB 2.1 MB/s            
Collecting setuptools
  Downloading setuptools-60.5.0-py3-none-any.whl (958 kB)
     |###########| 958 kB 2.1 MB/s            
Collecting wheel
  Downloading wheel-0.37.1-py2.py3-none-any.whl (35 kB)
Installing collected packages: wheel, setuptools, pip
Successfully installed pip-21.3.1 setuptools-60.5.0 wheel-0.37.1
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
root@desk-mx6ul-lynx:~# 

After the installation, pip3 is the latest version available for Python3 3.9.4:

root@desk-mx6ul-lynx:~# pip3 --version
pip 21.3.1 from /usr/lib/python3.9/site-packages/pip (python 3.9)
root@desk-mx6ul-lynx:~# 

Virtual environments[edit | edit source]

As explained on python3 12. Virtual Environments and Packages tutorial it is better to "create a virtual environment, a self-contained directory tree that contains a Python installation for a particular version of Python, plus a number of additional packages"

This avoids the problem related to Applications that sometimes need a specific version of a library. In this way it is possible to install the required packages (with their specific version required) only in this virtual environment (which may differ from the root installation).

  • for example, create the virtual environment named desk
root@desk-mx6ul-lynx:~# python3 -m venv desk-env
root@desk-mx6ul-lynx:~# which pip3
/usr/bin/pip3
root@desk-mx6ul-lynx:~# 
  • activate the virtual environment
root@desk-mx6ul-lynx:~# source desk-env/bin/activate
  • check and update pip3 in the the virtual environment
(desk-env) root@desk-mx6ul-lynx:~# which pip3
/home/root/desk-env/bin/pip3
(desk-env) root@desk-mx6ul-lynx:~# python3 -m pip install --upgrade pip
Collecting pip
  Using cached pip-21.3.1-py3-none-any.whl (1.7 MB)
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 20.2.3
    Uninstalling pip-20.2.3:
      Successfully uninstalled pip-20.2.3
Successfully installed pip-21.3.1
(desk-env) root@desk-mx6ul-lynx:~# pip3 --version
pip 21.3.1 from /home/root/desk-env/lib/python3.9/site-packages/pip (python 3.9)
(desk-env) root@desk-mx6ul-lynx:~# 
  • setuptools can be upgraded too:
(desk-env) root@desk-mx6ul-lynx:~# pip3 install --upgrade setuptools
Requirement already satisfied: setuptools in ./desk-env/lib/python3.9/site-packages (49.2.1)
Collecting setuptools
  Using cached setuptools-60.5.0-py3-none-any.whl (958 kB)
Installing collected packages: setuptools
  Attempting uninstall: setuptools
    Found existing installation: setuptools 49.2.1
    Uninstalling setuptools-49.2.1:
      Successfully uninstalled setuptools-49.2.1
  WARNING: Value for scheme.platlib does not match. Please report this to <https://github.com/pypa/pip/issues/10151>
  distutils: /home/root/desk-env/lib/python3.9/site-packages
  sysconfig: /usr/lib/python3.9/site-packages
  WARNING: Value for scheme.purelib does not match. Please report this to <https://github.com/pypa/pip/issues/10151>
  distutils: /home/root/desk-env/lib/python3.9/site-packages
  sysconfig: /usr/lib/python3.9/site-packages
  WARNING: Additional context:
  user = False
  home = None
  root = None
  prefix = None
Successfully installed setuptools-60.5.0
(desk-env) root@desk-mx6ul-lynx:~# 

Afterword, the wheel package is worth to be installed for further package installation:

(desk-env) root@desk-mx6ul-lynx:~# pip3 install wheel
Collecting wheel
  Using cached wheel-0.37.1-py2.py3-none-any.whl (35 kB)
Installing collected packages: wheel
  WARNING: Value for scheme.platlib does not match. Please report this to <https://github.com/pypa/pip/issues/10151>
  distutils: /home/root/desk-env/lib/python3.9/site-packages
  sysconfig: /usr/lib/python3.9/site-packages
  WARNING: Value for scheme.purelib does not match. Please report this to <https://github.com/pypa/pip/issues/10151>
  distutils: /home/root/desk-env/lib/python3.9/site-packages
  sysconfig: /usr/lib/python3.9/site-packages
  WARNING: Additional context:
  user = False
  home = None
  root = None
  prefix = None
Successfully installed wheel-0.37.1
(desk-env) root@desk-mx6ul-lynx:~#

pip package installation[edit | edit source]

For the purposes of this Application Note, pip3 has been used to install some python packages typically used in an Industrial Gateway equipment

In this example, the following packages are installed pyserial and pymodbus (for bus communications), flask, fastapi (web framework), bottle (lightweight WSGI micro web-framework), requests (HTTP library), schema, ssdp, scapy (network packet manipulation), nmap, ujson (JSON framework):

(desk-env) root@desk-mx6ul-lynx:~# pip3 install pyserial
Collecting pyserial
  Downloading pyserial-3.5-py2.py3-none-any.whl (90 kB)
     Collecting fastapi
  Downloading fastapi-0.72.0-py3-none-any.whl (52 kB)
     |████████████████████████████████| 52 kB 77 kB/s
Collecting pydantic!=1.7,!=1.7.1,!=1.7.2,!=1.7.3,!=1.8,!=1.8.1,<2.0.0,>=1.6.2
  Downloading pydantic-1.9.0-py3-none-any.whl (140 kB)
     |████████████████████████████████| 140 kB 2.1 MB/s
Collecting starlette==0.17.1
  Downloading starlette-0.17.1-py3-none-any.whl (58 kB)
     |████████████████████████████████| 58 kB 619 kB/s
Collecting anyio<4,>=3.0.0
  Downloading anyio-3.5.0-py3-none-any.whl (79 kB)
     |████████████████████████████████| 79 kB 797 kB/s
Collecting typing-extensions>=3.7.4.3
  Downloading typing_extensions-4.0.1-py3-none-any.whl (22 kB)
Collecting sniffio>=1.1
  Downloading sniffio-1.2.0-py3-none-any.whl (10 kB)
Collecting idna>=2.8
  Downloading idna-3.3-py3-none-any.whl (61 kB)
     |████████████████████████████████| 90 kB 780 kB/s            
Installing collected packages: pyserial
  WARNING: Value for scheme.platlib does not match. Please report this to <https://github.com/pypa/pip/issues/10151>
  distutils: /home/root/desk-env/lib/python3.9/site-packages
  sysconfig: /usr/lib/python3.9/site-packages
  WARNING: Value for scheme.purelib does not match. Please report this to <https://github.com/pypa/pip/issues/10151>
  distutils: /home/root/desk-env/lib/python3.9/site-packages
  sysconfig: /usr/lib/python3.9/site-packages
  WARNING: Additional context:
  user = False
  home = None
  root = None
  prefix = None
Successfully installed pyserial-3.5
(desk-env) root@desk-mx6ul-lynx:~# pip3 install pymodbus
Collecting pymodbus
  Downloading pymodbus-2.5.3-py2.py3-none-any.whl (154 kB)
     |████████████████████████████████| 154 kB 1.5 MB/s            
Collecting six>=1.15.0
  Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
Requirement already satisfied: pyserial>=3.4 in ./desk-env/lib/python3.9/site-packages (from pymodbus) (3.5)
Installing collected packages: six, pymodbus
  WARNING: Value for scheme.platlib does not match. Please report this to <https://github.com/pypa/pip/issues/10151>
  distutils: /home/root/desk-env/lib/python3.9/site-packages
  sysconfig: /usr/lib/python3.9/site-packages
  WARNING: Value for scheme.purelib does not match. Please report this to <https://github.com/pypa/pip/issues/10151>
  distutils: /home/root/desk-env/lib/python3.9/site-packages
  sysconfig: /usr/lib/python3.9/site-packages
  WARNING: Additional context:
  user = False
  home = None
  root = None
  prefix = None
Successfully installed pymodbus-2.5.3 six-1.16.0
(desk-env) root@desk-mx6ul-lynx:~# pip3 install flask
Collecting flask
  Downloading Flask-2.0.2-py3-none-any.whl (95 kB)
     |████████████████████████████████| 95 kB 422 kB/s
Collecting Werkzeug>=2.0
  Downloading Werkzeug-2.0.2-py3-none-any.whl (288 kB)
     |████████████████████████████████| 288 kB 2.1 MB/s
Collecting itsdangerous>=2.0
  Downloading itsdangerous-2.0.1-py3-none-any.whl (18 kB)
Collecting click>=7.1.2
  Downloading click-8.0.3-py3-none-any.whl (97 kB)
     |████████████████████████████████| 97 kB 226 kB/s
Collecting Jinja2>=3.0
  Downloading Jinja2-3.0.3-py3-none-any.whl (133 kB)
     |████████████████████████████████| 133 kB 2.1 MB/s
Collecting MarkupSafe>=2.0
  Downloading MarkupSafe-2.0.1.tar.gz (18 kB)
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: MarkupSafe
  Building wheel for MarkupSafe (setup.py) ... done
  Created wheel for MarkupSafe: filename=MarkupSafe-2.0.1-cp39-cp39-linux_armv7l.whl size=25720 sha256=4fa273af41ed51d0614beb76603162148fd15472aa0eb8c1c28a9c18ed137031
  Stored in directory: /home/root/.cache/pip/wheels/9f/6d/c8/1f59b07cf85ae842908006ec28f4477f7e4578df72c3eb0e46
Successfully built MarkupSafe
Installing collected packages: MarkupSafe, Werkzeug, Jinja2, itsdangerous, click, flask
  WARNING: Value for scheme.platlib does not match. Please report this to <https://github.com/pypa/pip/issues/10151>
  distutils: /home/root/desk-env/lib/python3.9/site-packages
  sysconfig: /usr/lib/python3.9/site-packages
  WARNING: Value for scheme.purelib does not match. Please report this to <https://github.com/pypa/pip/issues/10151>
  distutils: /home/root/desk-env/lib/python3.9/site-packages
  sysconfig: /usr/lib/python3.9/site-packages
  WARNING: Additional context:
  user = False
  home = None
  root = None
  prefix = None
Successfully installed Jinja2-3.0.3 MarkupSafe-2.0.1 Werkzeug-2.0.2 click-8.0.3 flask-2.0.2 itsdangerous-2.0.1
(desk-env) root@desk-mx6ul-lynx:~# pip3 install fastapi
Collecting fastapi
  Downloading fastapi-0.72.0-py3-none-any.whl (52 kB)
     |████████████████████████████████| 52 kB 77 kB/s
Collecting pydantic!=1.7,!=1.7.1,!=1.7.2,!=1.7.3,!=1.8,!=1.8.1,<2.0.0,>=1.6.2
  Downloading pydantic-1.9.0-py3-none-any.whl (140 kB)
     |████████████████████████████████| 140 kB 2.1 MB/s
Collecting starlette==0.17.1
  Downloading starlette-0.17.1-py3-none-any.whl (58 kB)
     |████████████████████████████████| 58 kB 619 kB/s
Collecting anyio<4,>=3.0.0
  Downloading anyio-3.5.0-py3-none-any.whl (79 kB)
     |████████████████████████████████| 79 kB 797 kB/s
Collecting typing-extensions>=3.7.4.3
  Downloading typing_extensions-4.0.1-py3-none-any.whl (22 kB)
Collecting sniffio>=1.1
  Downloading sniffio-1.2.0-py3-none-any.whl (10 kB)
Collecting idna>=2.8
  Downloading idna-3.3-py3-none-any.whl (61 kB)
     |████████████████████████████████| 61 kB 770 kB/s
Installing collected packages: sniffio, idna, typing-extensions, anyio, starlette, pydantic, fastapi
  WARNING: Value for scheme.platlib does not match. Please report this to <https://github.com/pypa/pip/issues/10151>
  distutils: /home/root/desk-env/lib/python3.9/site-packages
  sysconfig: /usr/lib/python3.9/site-packages
  WARNING: Value for scheme.purelib does not match. Please report this to <https://github.com/pypa/pip/issues/10151>
  distutils: /home/root/desk-env/lib/python3.9/site-packages
  sysconfig: /usr/lib/python3.9/site-packages
  WARNING: Additional context:
  user = False
  home = None
  root = None
  prefix = None
Successfully installed anyio-3.5.0 fastapi-0.72.0 idna-3.3 pydantic-1.9.0 sniffio-1.2.0 starlette-0.17.1 typing-extensions-4.0.1
(desk-env) root@desk-mx6ul-lynx:~# pip3 install bottle
Collecting bottle
  Downloading bottle-0.12.19-py3-none-any.whl (89 kB)
     |████████████████████████████████| 89 kB 724 kB/s
Installing collected packages: bottle
  WARNING: Value for scheme.platlib does not match. Please report this to <https://github.com/pypa/pip/issues/10151>
  distutils: /home/root/desk-env/lib/python3.9/site-packages
  sysconfig: /usr/lib/python3.9/site-packages
  WARNING: Value for scheme.purelib does not match. Please report this to <https://github.com/pypa/pip/issues/10151>
  distutils: /home/root/desk-env/lib/python3.9/site-packages
  sysconfig: /usr/lib/python3.9/site-packages
  WARNING: Additional context:
  user = False
  home = None
  root = None
  prefix = None
Successfully installed bottle-0.12.19
(desk-env) root@desk-mx6ul-lynx:~# pip3 install requests
Collecting requests
  Downloading requests-2.27.1-py2.py3-none-any.whl (63 kB)
     |████████████████████████████████| 63 kB 141 kB/s
Requirement already satisfied: idna<4,>=2.5 in ./desk-env/lib/python3.9/site-packages (from requests) (3.3)
Collecting charset-normalizer~=2.0.0
  Downloading charset_normalizer-2.0.10-py3-none-any.whl (39 kB)
Collecting certifi>=2017.4.17
  Downloading certifi-2021.10.8-py2.py3-none-any.whl (149 kB)
     |████████████████████████████████| 149 kB 2.2 MB/s
Collecting urllib3<1.27,>=1.21.1
  Downloading urllib3-1.26.8-py2.py3-none-any.whl (138 kB)
     |████████████████████████████████| 138 kB 2.2 MB/s
Installing collected packages: urllib3, charset-normalizer, certifi, requests
  WARNING: Value for scheme.platlib does not match. Please report this to <https://github.com/pypa/pip/issues/10151>
  distutils: /home/root/desk-env/lib/python3.9/site-packages
  sysconfig: /usr/lib/python3.9/site-packages
  WARNING: Value for scheme.purelib does not match. Please report this to <https://github.com/pypa/pip/issues/10151>
  distutils: /home/root/desk-env/lib/python3.9/site-packages
  sysconfig: /usr/lib/python3.9/site-packages
  WARNING: Additional context:
  user = False
  home = None
  root = None
  prefix = None
Successfully installed certifi-2021.10.8 charset-normalizer-2.0.10 requests-2.27.1 urllib3-1.26.8
(desk-env) root@desk-mx6ul-lynx:~# pip3 install schema
Collecting schema
  Downloading schema-0.7.5-py2.py3-none-any.whl (17 kB)
Collecting contextlib2>=0.5.5
  Downloading contextlib2-21.6.0-py2.py3-none-any.whl (13 kB)
Installing collected packages: contextlib2, schema
  WARNING: Value for scheme.platlib does not match. Please report this to <https://github.com/pypa/pip/issues/10151>
  distutils: /home/root/desk-env/lib/python3.9/site-packages
  sysconfig: /usr/lib/python3.9/site-packages
  WARNING: Value for scheme.purelib does not match. Please report this to <https://github.com/pypa/pip/issues/10151>
  distutils: /home/root/desk-env/lib/python3.9/site-packages
  sysconfig: /usr/lib/python3.9/site-packages
  WARNING: Additional context:
  user = False
  home = None
  root = None
  prefix = None
Successfully installed contextlib2-21.6.0 schema-0.7.5
(desk-env) root@desk-mx6ul-lynx:~# pip3 install ssdp
Collecting ssdp
  Downloading ssdp-1.1.0-py2.py3-none-any.whl (4.3 kB)
Installing collected packages: ssdp
  WARNING: Value for scheme.platlib does not match. Please report this to <https://github.com/pypa/pip/issues/10151>
  distutils: /home/root/desk-env/lib/python3.9/site-packages
  sysconfig: /usr/lib/python3.9/site-packages
  WARNING: Value for scheme.purelib does not match. Please report this to <https://github.com/pypa/pip/issues/10151>
  distutils: /home/root/desk-env/lib/python3.9/site-packages
  sysconfig: /usr/lib/python3.9/site-packages
  WARNING: Additional context:
  user = False
  home = None
  root = None
  prefix = None
Successfully installed ssdp-1.1.0
(desk-env) root@desk-mx6ul-lynx:~# pip3 install scapy
Collecting scapy
  Downloading scapy-2.4.5.tar.gz (1.1 MB)
     |████████████████████████████████| 1.1 MB 1.4 MB/s
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: scapy
  Building wheel for scapy (setup.py) ... done
  Created wheel for scapy: filename=scapy-2.4.5-py2.py3-none-any.whl size=1261555 sha256=df65309a4f5e0ee8e9f5da16f5b22b41c5a3d0ab03d671f788451874deeca183
  Stored in directory: /home/root/.cache/pip/wheels/c8/9b/2f/012f0dbaf869afac8be52d4423f34eaa0b6c5c2d1292e40ebd
Successfully built scapy
Installing collected packages: scapy
  WARNING: Value for scheme.platlib does not match. Please report this to <https://github.com/pypa/pip/issues/10151>
  distutils: /home/root/desk-env/lib/python3.9/site-packages
  sysconfig: /usr/lib/python3.9/site-packages
  WARNING: Value for scheme.purelib does not match. Please report this to <https://github.com/pypa/pip/issues/10151>
  distutils: /home/root/desk-env/lib/python3.9/site-packages
  sysconfig: /usr/lib/python3.9/site-packages
  WARNING: Additional context:
  user = False
  home = None
  root = None
  prefix = None
Successfully installed scapy-2.4.5
(desk-env) root@desk-mx6ul-lynx:~# pip3 install nmap
Collecting nmap
  Downloading nmap-0.0.1-py3-none-any.whl (2.7 kB)
Installing collected packages: nmap
  WARNING: Value for scheme.platlib does not match. Please report this to <https://github.com/pypa/pip/issues/10151>
  distutils: /home/root/desk-env/lib/python3.9/site-packages
  sysconfig: /usr/lib/python3.9/site-packages
  WARNING: Value for scheme.purelib does not match. Please report this to <https://github.com/pypa/pip/issues/10151>
  distutils: /home/root/desk-env/lib/python3.9/site-packages
  sysconfig: /usr/lib/python3.9/site-packages
  WARNING: Additional context:
  user = False
  home = None
  root = None
  prefix = None
Successfully installed nmap-0.0.1
(desk-env) root@desk-mx6ul-lynx:~# pip3 install ujson
Collecting ujson
  Downloading ujson-5.1.0.tar.gz (7.1 MB)
     |████████████████████████████████| 7.1 MB 10 kB/s
  WARNING: Value for prefixed-purelib does not match. Please report this to <https://github.com/pypa/pip/issues/10151>
  distutils: /tmp/pip-build-env-y3_ib386/normal/lib/python3.9/site-packages
  sysconfig: /usr/lib/python3.9/site-packages
  WARNING: Value for prefixed-platlib does not match. Please report this to <https://github.com/pypa/pip/issues/10151>
  distutils: /tmp/pip-build-env-y3_ib386/normal/lib/python3.9/site-packages
  sysconfig: /usr/lib/python3.9/site-packages
  WARNING: Additional context:
  user = False
  home = None
  root = None
  prefix = '/tmp/pip-build-env-y3_ib386/normal'
  WARNING: Value for prefixed-purelib does not match. Please report this to <https://github.com/pypa/pip/issues/10151>
  distutils: /tmp/pip-build-env-y3_ib386/overlay/lib/python3.9/site-packages
  sysconfig: /usr/lib/python3.9/site-packages
  WARNING: Value for prefixed-platlib does not match. Please report this to <https://github.com/pypa/pip/issues/10151>
  distutils: /tmp/pip-build-env-y3_ib386/overlay/lib/python3.9/site-packages
  sysconfig: /usr/lib/python3.9/site-packages
  WARNING: Additional context:
  user = False
  home = None
  root = None
  prefix = '/tmp/pip-build-env-y3_ib386/overlay'
  WARNING: Value for purelib does not match. Please report this to <https://github.com/pypa/pip/issues/10151>
  distutils: /home/root/desk-env/lib/python3.9/site-packages
  sysconfig: /usr/lib/python3.9/site-packages
  WARNING: Additional context:
  user = False
  home = None
  root = None
  prefix = None
  WARNING: Value for platlib does not match. Please report this to <https://github.com/pypa/pip/issues/10151>
  distutils: /home/root/desk-env/lib/python3.9/site-packages
  sysconfig: /usr/lib/python3.9/site-packages
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: ujson
  Building wheel for ujson (pyproject.toml) ... done
  Created wheel for ujson: filename=ujson-5.1.0-cp39-cp39-linux_armv7l.whl size=37764 sha256=adb6cfae7a4edcd38706c5b910adeee4549af56433bbe17eed89b08f77dd25aa
  Stored in directory: /home/root/.cache/pip/wheels/5b/11/cb/2e1acde83fd78adc6581984c55442e63d7595711b0b62d8110
Successfully built ujson
Installing collected packages: ujson
  WARNING: Value for scheme.platlib does not match. Please report this to <https://github.com/pypa/pip/issues/10151>
  distutils: /home/root/desk-env/lib/python3.9/site-packages
  sysconfig: /usr/lib/python3.9/site-packages
  WARNING: Value for scheme.purelib does not match. Please report this to <https://github.com/pypa/pip/issues/10151>
  distutils: /home/root/desk-env/lib/python3.9/site-packages
  sysconfig: /usr/lib/python3.9/site-packages
  WARNING: Additional context:
  user = False
  home = None
  root = None
  prefix = None
Successfully installed ujson-5.1.0
(desk-env) root@desk-mx6ul-lynx:~#

check for installed packages and version[edit | edit source]

(desk-env) root@desk-mx6ul-lynx:~# pip3 list
Package            Version
------------------ ---------
anyio              3.5.0
bottle             0.12.19
certifi            2021.10.8
charset-normalizer 2.0.10
click              8.0.3
contextlib2        21.6.0
fastapi            0.72.0
Flask              2.0.2
idna               3.3
itsdangerous       2.0.1
Jinja2             3.0.3
MarkupSafe         2.0.1
nmap               0.0.1
pip                21.3.1
pydantic           1.9.0
pymodbus           2.5.3
pyserial           3.5
requests           2.27.1
scapy              2.4.5
schema             0.7.5
setuptools         60.5.0
six                1.16.0
sniffio            1.2.0
ssdp               1.1.0
starlette          0.17.1
typing_extensions  4.0.1
ujson              5.1.0
urllib3            1.26.8
Werkzeug           2.0.2
wheel              0.37.1
(desk-env) root@desk-mx6ul-lynx:~# 

import packages[edit | edit source]

Finally, after the installation steps, it is possible to import the packages:

(desk-env) root@desk-mx6ul-lynx:~# python3
Python 3.9.4 (default, Apr  4 2021, 18:23:51) 
[GCC 10.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> import os
>>> import time
>>> import ssl
>>> import nmap
>>> import scapy
>>> import serial
>>> import pymodbus
>>> import schema
>>> import ssdp
>>> import requests
>>> import flask
>>> import fastapi
>>> import bottle
>>> import ujson
>>> 
(desk-env) root@desk-mx6ul-lynx:~#