OpenWRT + Python/NumPy

встраиваемые модели

Модераторы: Olej, vikos

Аватара пользователя
Olej
Писатель
Сообщения: 21338
Зарегистрирован: 24 сен 2011, 14:22
Откуда: Харьков
Контактная информация:

OpenWRT + Python/NumPy

Непрочитанное сообщение Olej » 19 авг 2023, 00:39

Возник вопрос: установки или сорки + использовании NumPy в инсталляции OpenWRT.
Для этого, собственно, и был собран/восстановлен стенд в VirtualBox: OpenWRT.
(Но это пока только для x86 архитектуры)

Аватара пользователя
Olej
Писатель
Сообщения: 21338
Зарегистрирован: 24 сен 2011, 14:22
Откуда: Харьков
Контактная информация:

OpenWRT + Python/NumPy

Непрочитанное сообщение Olej » 19 авг 2023, 00:51

Код: Выделить всё

root@OpenWrt:~$ which python
root@OpenWrt:~$ 

Код: Выделить всё

root@OpenWrt:~# opkg find python* | grep ^python3 | wc -l
405

Код: Выделить всё

root@OpenWrt:~$ opkg find python3 
python3 - 3.10.12-1 - This package contains the (almost) full Python install.
 It's python3-light + all other packages.

Код: Выделить всё

root@OpenWrt:~$ opkg find python3* | grep pip
python3-apipkg - 1.5-2 - apipkg is used to control the exported namespace of a Python package and greatly reduce the number of imports for users.
python3-apipkg-src - 1.5-2 - apipkg is used to control the exported namespace of a Python package and greatly reduce the number of imports for users.  This package contains the Python source files for python3-apipkg.
python3-packages - 1.0-1 - A dummy package for packaging python3 modules with pip
python3-pip - 23.0.1-1 - Python 3.10 pip module
python3-pip-src - 23.0.1-1 - Python 3.10 pip module  This package contains the Python source files for python3-pip.

Аватара пользователя
Olej
Писатель
Сообщения: 21338
Зарегистрирован: 24 сен 2011, 14:22
Откуда: Харьков
Контактная информация:

OpenWRT + Python/NumPy

Непрочитанное сообщение Olej » 19 авг 2023, 00:55

Код: Выделить всё

root@OpenWrt:~$ opkg install python3
Installing python3 (3.10.12-1) to root...
Downloading https://downloads.openwrt.org/releases/22.03.4/packages/x86_64/packages/python3_3.10.12-1_x86_64.ipk
Installing libpython3-3.10 (3.10.12-1) to root...
Downloading https://downloads.openwrt.org/releases/22.03.4/packages/x86_64/packages/libpython3-3.10_3.10.12-1_x86_64.ipk
Installing python3-base (3.10.12-1) to root...
Downloading https://downloads.openwrt.org/releases/22.03.4/packages/x86_64/packages/python3-base_3.10.12-1_x86_64.ipk
Installing libbz2-1.0 (1.0.8-1) to root...
Downloading https://downloads.openwrt.org/releases/22.03.4/packages/x86_64/base/libbz2-1.0_1.0.8-1_x86_64.ipk
Installing python3-light (3.10.12-1) to root...
Downloading https://downloads.openwrt.org/releases/22.03.4/packages/x86_64/packages/python3-light_3.10.12-1_x86_64.ipk
Installing python3-asyncio (3.10.12-1) to root...
Downloading https://downloads.openwrt.org/releases/22.03.4/packages/x86_64/packages/python3-asyncio_3.10.12-1_x86_64.ipk
Installing python3-email (3.10.12-1) to root...
Downloading https://downloads.openwrt.org/releases/22.03.4/packages/x86_64/packages/python3-email_3.10.12-1_x86_64.ipk
Installing python3-cgi (3.10.12-1) to root...
Downloading https://downloads.openwrt.org/releases/22.03.4/packages/x86_64/packages/python3-cgi_3.10.12-1_x86_64.ipk
Installing python3-pydoc (3.10.12-1) to root...
Downloading https://downloads.openwrt.org/releases/22.03.4/packages/x86_64/packages/python3-pydoc_3.10.12-1_x86_64.ipk
Installing python3-cgitb (3.10.12-1) to root...
Downloading https://downloads.openwrt.org/releases/22.03.4/packages/x86_64/packages/python3-cgitb_3.10.12-1_x86_64.ipk
Installing python3-codecs (3.10.12-1) to root...
Downloading https://downloads.openwrt.org/releases/22.03.4/packages/x86_64/packages/python3-codecs_3.10.12-1_x86_64.ipk
Installing python3-ctypes (3.10.12-1) to root...
Downloading https://downloads.openwrt.org/releases/22.03.4/packages/x86_64/packages/python3-ctypes_3.10.12-1_x86_64.ipk
Installing libgdbm (1.21-1) to root...
Downloading https://downloads.openwrt.org/releases/22.03.4/packages/x86_64/packages/libgdbm_1.21-1_x86_64.ipk
Installing python3-dbm (3.10.12-1) to root...
Downloading https://downloads.openwrt.org/releases/22.03.4/packages/x86_64/packages/python3-dbm_3.10.12-1_x86_64.ipk
Installing python3-decimal (3.10.12-1) to root...
Downloading https://downloads.openwrt.org/releases/22.03.4/packages/x86_64/packages/python3-decimal_3.10.12-1_x86_64.ipk
Installing python3-distutils (3.10.12-1) to root...
Downloading https://downloads.openwrt.org/releases/22.03.4/packages/x86_64/packages/python3-distutils_3.10.12-1_x86_64.ipk
Installing python3-logging (3.10.12-1) to root...
Downloading https://downloads.openwrt.org/releases/22.03.4/packages/x86_64/packages/python3-logging_3.10.12-1_x86_64.ipk
Installing liblzma (5.4.1-1) to root...
Downloading https://downloads.openwrt.org/releases/22.03.4/packages/x86_64/packages/liblzma_5.4.1-1_x86_64.ipk
Installing python3-lzma (3.10.12-1) to root...
Downloading https://downloads.openwrt.org/releases/22.03.4/packages/x86_64/packages/python3-lzma_3.10.12-1_x86_64.ipk
Installing python3-multiprocessing (3.10.12-1) to root...
Downloading https://downloads.openwrt.org/releases/22.03.4/packages/x86_64/packages/python3-multiprocessing_3.10.12-1_x86_64.ipk
Installing python3-ncurses (3.10.12-1) to root...
Downloading https://downloads.openwrt.org/releases/22.03.4/packages/x86_64/packages/python3-ncurses_3.10.12-1_x86_64.ipk
Installing python3-openssl (3.10.12-1) to root...
Downloading https://downloads.openwrt.org/releases/22.03.4/packages/x86_64/packages/python3-openssl_3.10.12-1_x86_64.ipk
Installing libreadline8 (8.1-1) to root...
Downloading https://downloads.openwrt.org/releases/22.03.4/packages/x86_64/base/libreadline8_8.1-1_x86_64.ipk
Installing python3-readline (3.10.12-1) to root...
Downloading https://downloads.openwrt.org/releases/22.03.4/packages/x86_64/packages/python3-readline_3.10.12-1_x86_64.ipk
Installing libsqlite3-0 (3410200-1) to root...
Downloading https://downloads.openwrt.org/releases/22.03.4/packages/x86_64/packages/libsqlite3-0_3410200-1_x86_64.ipk
Installing python3-sqlite3 (3.10.12-1) to root...
Downloading https://downloads.openwrt.org/releases/22.03.4/packages/x86_64/packages/python3-sqlite3_3.10.12-1_x86_64.ipk
Installing python3-unittest (3.10.12-1) to root...
Downloading https://downloads.openwrt.org/releases/22.03.4/packages/x86_64/packages/python3-unittest_3.10.12-1_x86_64.ipk
Installing python3-urllib (3.10.12-1) to root...
Downloading https://downloads.openwrt.org/releases/22.03.4/packages/x86_64/packages/python3-urllib_3.10.12-1_x86_64.ipk
Installing python3-uuid (3.10.12-1) to root...
Downloading https://downloads.openwrt.org/releases/22.03.4/packages/x86_64/packages/python3-uuid_3.10.12-1_x86_64.ipk
Installing python3-xml (3.10.12-1) to root...
Downloading https://downloads.openwrt.org/releases/22.03.4/packages/x86_64/packages/python3-xml_3.10.12-1_x86_64.ipk
Configuring libbz2-1.0.
Configuring libpython3-3.10.
Configuring python3-base.
Configuring python3-light.
Configuring python3-email.
Configuring python3-urllib.
Configuring python3-pydoc.
Configuring liblzma.
Configuring python3-cgi.
Configuring python3-cgitb.
Configuring python3-decimal.
Configuring python3-uuid.
Configuring python3-xml.
Configuring libsqlite3-0.
Configuring python3-ncurses.
Configuring python3-distutils.
Configuring python3-codecs.
Configuring python3-multiprocessing.
Configuring libreadline8.
Configuring python3-asyncio.
Configuring python3-ctypes.
Configuring libgdbm.
Configuring python3-dbm.
Configuring python3-logging.
Configuring python3-lzma.
Configuring python3-openssl.
Configuring python3-readline.
Configuring python3-sqlite3.
Configuring python3-unittest.
Configuring python3.

Код: Выделить всё

root@OpenWrt:~# python --version
Python 3.10.12

Аватара пользователя
Olej
Писатель
Сообщения: 21338
Зарегистрирован: 24 сен 2011, 14:22
Откуда: Харьков
Контактная информация:

OpenWRT + Python/NumPy

Непрочитанное сообщение Olej » 19 авг 2023, 00:58

Код: Выделить всё

root@OpenWrt:~$ opkg install python3-pip
Installing python3-pip (23.0.1-1) to root...
Downloading https://downloads.openwrt.org/releases/22.03.4/packages/x86_64/packages/python3-pip_23.0.1-1_x86_64.ipk
Installing python3-pkg-resources (65.5.0-1) to root...
Downloading https://downloads.openwrt.org/releases/22.03.4/packages/x86_64/packages/python3-pkg-resources_65.5.0-1_x86_64.ipk
Installing python3-setuptools (65.5.0-1) to root...
Downloading https://downloads.openwrt.org/releases/22.03.4/packages/x86_64/packages/python3-setuptools_65.5.0-1_x86_64.ipk
Installing python-pip-conf (0.1-1) to root...
Downloading https://downloads.openwrt.org/releases/22.03.4/packages/x86_64/packages/python-pip-conf_0.1-1_x86_64.ipk
Configuring python-pip-conf.
Configuring python3-pkg-resources.
Configuring python3-setuptools.
Configuring python3-pip.

Код: Выделить всё

root@OpenWrt:~# pip --version
pip 23.0.1 from /usr/lib/python3.10/site-packages/pip (python 3.10)

Код: Выделить всё

root@OpenWrt:~# pip help

Usage:   
  pip <command> [options]

Commands:
  install                     Install packages.
  download                    Download packages.
  uninstall                   Uninstall packages.
  freeze                      Output installed packages in requirements format.
  inspect                     Inspect the python environment.
  list                        List installed packages.
  show                        Show information about installed packages.
  check                       Verify installed packages have compatible dependencies.
  config                      Manage local and global configuration.
  search                      Search PyPI for packages.
  cache                       Inspect and manage pip's wheel cache.
  index                       Inspect information available from package indexes.
  wheel                       Build wheels from your requirements.
  hash                        Compute hashes of package archives.
  completion                  A helper command used for command completion.
  debug                       Show information useful for debugging.
  help                        Show help for commands.

General Options:
  -h, --help                  Show help.
  --debug                     Let unhandled exceptions propagate outside the main subroutine, instead of logging them to stderr.
  --isolated                  Run pip in an isolated mode, ignoring environment variables and user configuration.
  --require-virtualenv        Allow pip to only run in a virtual environment; exit with an error otherwise.
  --python <python>           Run pip with the specified Python interpreter.
  -v, --verbose               Give more output. Option is additive, and can be used up to 3 times.
  -V, --version               Show version and exit.
  -q, --quiet                 Give less output. Option is additive, and can be used up to 3 times (corresponding to WARNING, ERROR, and CRITICAL logging levels).
  --log <path>                Path to a verbose appending log.
  --no-input                  Disable prompting for input.
  --proxy <proxy>             Specify a proxy in the form scheme://[user:passwd@]proxy.server:port.
  --retries <retries>         Maximum number of retries each connection should attempt (default 5 times).
  --timeout <sec>             Set the socket timeout (default 15 seconds).
  --exists-action <action>    Default action when a path already exists: (s)witch, (i)gnore, (w)ipe, (b)ackup, (a)bort.
  --trusted-host <hostname>   Mark this host or host:port pair as trusted, even though it does not have valid or any HTTPS.
  --cert <path>               Path to PEM-encoded CA certificate bundle. If provided, overrides the default. See 'SSL Certificate Verification' in pip documentation for
                              more information.
  --client-cert <path>        Path to SSL client certificate, a single file containing the private key and the certificate in PEM format.
  --cache-dir <dir>           Store the cache data in <dir>.
  --no-cache-dir              Disable the cache.
  --disable-pip-version-check
                              Don't periodically check PyPI to determine whether a new version of pip is available for download. Implied with --no-index.
  --no-color                  Suppress colored output.
  --no-python-version-warning
                              Silence deprecation warnings for upcoming unsupported Pythons.
  --use-feature <feature>     Enable new functionality, that may be backward incompatible.
  --use-deprecated <feature>  Enable deprecated functionality, that will be removed in the future.

Код: Выделить всё

root@OpenWrt:~# pip list
Package    Version
---------- -------
pip        23.0.1
setuptools 65.5.0

[notice] A new release of pip is available: 23.0.1 -> 23.2.1
[notice] To update, run: pip install --upgrade pip

Код: Выделить всё

root@OpenWrt:~# pip install --upgrade pip
Requirement already satisfied: pip in /usr/lib/python3.10/site-packages (23.0.1)
Collecting pip
  Downloading pip-23.2.1-py3-none-any.whl (2.1 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 MB 2.7 MB/s eta 0:00:00
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 23.0.1
    Uninstalling pip-23.0.1:
      Successfully uninstalled pip-23.0.1
Successfully installed pip-23.2.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@OpenWrt:~$ pip --version
pip 23.2.1 from /usr/lib/python3.10/site-packages/pip (python 3.10)

Аватара пользователя
Olej
Писатель
Сообщения: 21338
Зарегистрирован: 24 сен 2011, 14:22
Откуда: Харьков
Контактная информация:

OpenWRT + Python/NumPy

Непрочитанное сообщение Olej » 19 авг 2023, 01:08

Код: Выделить всё

root@OpenWrt:~# opkg install python3-numpy
Installing python3-numpy (1.23.3-1) to root...
Downloading https://downloads.openwrt.org/releases/22.03.4/packages/x86_64/packages/python3-numpy_1.23.3-1_x86_64.ipk
Configuring python3-numpy.

Код: Выделить всё

root@OpenWrt:~# pip list
Package    Version
---------- -------
numpy      1.23.3
pip        23.2.1
setuptools 65.5.0
Т.е. для архитектуры x86 не нужно ничего собирать из исходников, numpy ... да и весь джентльменский набор пакетов Python присутствует в стандартном репозитории.

Аватара пользователя
Olej
Писатель
Сообщения: 21338
Зарегистрирован: 24 сен 2011, 14:22
Откуда: Харьков
Контактная информация:

OpenWRT + Python/NumPy

Непрочитанное сообщение Olej » 19 авг 2023, 01:13

Olej писал(а):
19 авг 2023, 01:08
Т.е. для архитектуры x86 не нужно ничего собирать из исходников, numpy ... да и весь джентльменский набор пакетов Python присутствует в стандартном репозитории.
Возможно для других архитектур: ARM, MIPS, ... готового в репозитории нет и нужно копать исходники для сборки.
Это нужно бы проверить...
Исходники всего что относится к Python, указывают, что здесь в GIT Python packages folder.

И - задача 2 - если уж установил NumPy - проверить его фунциональность.

Ответить

Вернуться в «Одноплатные компьютеры»

Кто сейчас на конференции

Сейчас этот форум просматривают: нет зарегистрированных пользователей и 4 гостя