Open main menu

DAVE Developer's Wiki β

Changes

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

3,088 bytes removed, 12:28, 7 October 2021
no edit summary
</pre>
This shows that <code>pip3</code> is not present in the root file system and should be installed: the simpler way is using python3 itself and the provided python script [https://bootstrap.pypa.io/pip/3.5/get-pip.py get-pip.py] for version 3.5:
<pre class="board-terminal">
Processing dependencies for scapy
Finished processing dependencies for scapy
root@desk-mx6ul-axelulite:~#
</pre>
 
On top of that, some web packages are very useful for creating web applications and remotely control/get information from the gateway as '''[https://pypi.org/project/fastapi/ fastapi]''' (high-performance web framework):
 
<pre class="board-terminal">
root@desk-mx6ul-axelulite:~# easy3_install fastapi
Searching for fastapi
Reading https://pypi.python.org/simple/fastapi/
Downloading https://files.pythonhosted.org/packages/92/a8/10d8a171afa66e6e8a5cfe82771d11c4c84a2a874c19c0b55c7099001fac/fastapi-0.68.2-py3-none-any.whl#sha256=36bcdd3dbea87c586061005e4a40b9bd0145afd766655b4e0ec1d8870b32555c
Best match: fastapi 0.68.2
Processing fastapi-0.68.2-py3-none-any.whl
Installing fastapi-0.68.2-py3-none-any.whl to /usr/lib/python3.5/site-packages
writing requirements to /usr/lib/python3.5/site-packages/fastapi-0.68.2-py3.5.egg/EGG-INFO/requires.txt
Adding fastapi 0.68.2 to easy-install.pth file
 
Installed /usr/lib/python3.5/site-packages/fastapi-0.68.2-py3.5.egg
Processing dependencies for fastapi
Searching for starlette==0.14.2
Reading https://pypi.python.org/simple/starlette/
Downloading https://files.pythonhosted.org/packages/15/34/db1890f442a1cd3a2c761f4109a0eb4e63503218d70a8c8e97faa09a5500/starlette-0.14.2-py3-none-any.whl#sha256=3c8e48e52736b3161e34c9f0e8153b4f32ec5d8995a3ee1d59410d92f75162ed
Best match: starlette 0.14.2
Processing starlette-0.14.2-py3-none-any.whl
Installing starlette-0.14.2-py3-none-any.whl to /usr/lib/python3.5/site-packages
writing requirements to /usr/lib/python3.5/site-packages/starlette-0.14.2-py3.5.egg/EGG-INFO/requires.txt
Adding starlette 0.14.2 to easy-install.pth file
 
Installed /usr/lib/python3.5/site-packages/starlette-0.14.2-py3.5.egg
Searching for pydantic!=1.7,!=1.7.1,!=1.7.2,!=1.7.3,!=1.8,!=1.8.1,<2.0.0,>=1.6.2
Reading https://pypi.python.org/simple/pydantic/
Downloading https://files.pythonhosted.org/packages/ff/74/54e030641601112309f6d2af620774e9080f99c7a15742fc6a0b170c4076/pydantic-1.8.2-py3-none-any.whl#sha256=fec866a0b59f372b7e776f2d7308511784dace622e0992a0b59ea3ccee0ae833
Best match: pydantic 1.8.2
Processing pydantic-1.8.2-py3-none-any.whl
Installing pydantic-1.8.2-py3-none-any.whl to /usr/lib/python3.5/site-packages
writing requirements to /usr/lib/python3.5/site-packages/pydantic-1.8.2-py3.5.egg/EGG-INFO/requires.txt
Adding pydantic 1.8.2 to easy-install.pth file
 
Installed /usr/lib/python3.5/site-packages/pydantic-1.8.2-py3.5.egg
Searching for typing-extensions>=3.7.4.3
Reading https://pypi.python.org/simple/typing-extensions/
Downloading https://files.pythonhosted.org/packages/74/60/18783336cc7fcdd95dae91d73477830aa53f5d3181ae4fe20491d7fc3199/typing_extensions-3.10.0.2-py3-none-any.whl#sha256=f1d25edafde516b146ecd0613dabcc61409817af4766fbbcfb8d1ad4ec441a34
Best match: typing-extensions 3.10.0.2
Processing typing_extensions-3.10.0.2-py3-none-any.whl
Installing typing_extensions-3.10.0.2-py3-none-any.whl to /usr/lib/python3.5/site-packages
Adding typing-extensions 3.10.0.2 to easy-install.pth file
 
Installed /usr/lib/python3.5/site-packages/typing_extensions-3.10.0.2-py3.5.egg
Finished processing dependencies for fastapi
 
root@desk-mx6ul-axelulite:~#
</pre>
=== pip ===
It is possible to use <code>pip3</code> On top of that, some web packages are very useful for installing other creating webapplications and remotely control/API framework get information from the gateway like '''[https://bottlepy.org/docs/dev/ bottle]''' (lightweight WSGI micro web-framework) and '''[https://flask.palletsprojects.com/en/2.0.x/ flask]''':
<pre class="board-terminal">
In case of some troubles (which can happens using <code>easy_install</code> or <code>pip</code>), other packages can be directly installed using <code>dnf</code> from the already built ''rpm'' packages built with Yocto.
For example, when ''non-pure'' python packages or in case of mismatched versions, to install them from the pre-build images in Yocto, for example '''[https://flask.palletsprojects.com/en/2.0.x/ flask]'''::
<pre class="board-terminal">
8,221
edits