Open main menu

DAVE Developer's Wiki β

Changes

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

1,229 bytes added, 16:10, 20 January 2022
Virtual environments
<pre class="board-terminal">
root@desk-mx6ul-lynx:~# source desk-env/bin/activate
</pre>
* check and update ''pip3'' in the the <code>virtual environment</code>
<pre class="board-terminal">
(desk-env) root@desk-mx6ul-lynx:~# which pip3
/home/root/desk-env/bin/pip3
(desk-env) root@desk-mx6ul-lynx:~#</pre>* update ''pip3'' in the the <code>virtual environment</code><pre class="board-terminal">(desk-env) root@desk-mx6ul-lynx:~# /home/root/desk-env/bin/python3 -m pip install --upgrade pip
Collecting pip
Using cached pip-21.3.1-py3-none-any.whl (1.7 MB)
Successfully uninstalled pip-20.2.3
Successfully installed pip-21.3.1
(desk-env) root@desk-mx6ul-lynx:~# /home/root/desk-env/bin/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:~#
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).
 
After pip3 installation, the available (base) packages are:
 
<pre class="board-terminal">
root@desk-mx6ul-lynx:~# pip3 list
Package Version
---------- --------------
btrfsutil 5.10.1
gpg 1.15.1-unknown
iniparse 0.4
libcomps 0.1.15
pip 21.3.1
PyGObject 3.38.0
setuptools 60.5.0
six 1.15.0
wheel 0.37.1
root@desk-mx6ul-lynx:~#
</pre>
 
Afterword, the [https://pypi.org/project/wheel/ wheel] package is worth to be installed for further package installation:
<pre class="board-terminal">
(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:~#
</pre>
=== pip package installation===
8,204
edits