I am trying to add python functionality to my OpenWRT box, but installing python packages seems to fail all the time. And I cannot figure it out why. I have tried installing everything under the sun that is even remotely related to getting numpy in my box, but it throws just a bunch of errors:
root@OpenWrt:~# pip3 install numpy --no-binary :all:
Collecting numpy
Using cached numpy-1.21.0.zip (10.3 MB)
Installing build dependencies ... error
WARNING: Discarding https://files.pythonhosted.org/packages/66/03/818876390c7ff4484d5a05398a618cfdaf0a2b9abb3a7c7ccd59fe181008/numpy-1.21.0.zip#sha256=e80fe25cba41c124d04c662f33f6364909b985f2eb5998aaa5ae4b9587242cce (from https://pypi.org/simple/numpy/) (requires-python:>=3.7). Command errored out with exit status 1: /usr/bin/python3 /tmp/pip-standalone-pip-6h1qf1lv/__env_pip__.zip/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-i82anqdb/overlay --no-warn-script-location -v --no-binary :all: --only-binary :none: -i https://pypi.org/simple -- 'packaging==20.5; platform_machine=='"'"'arm64'"'"'' 'setuptools<49.2.0' wheel==0.36.2 'Cython>=0.29.21,<3.0' Check the logs for full command output.
Using cached numpy-1.20.3.zip (7.8 MB)
Installing build dependencies ... error
WARNING: Discarding https://files.pythonhosted.org/packages/f3/1f/fe9459e39335e7d0e372b5e5dcd60f4381d3d1b42f0b9c8222102ff29ded/numpy-1.20.3.zip#sha256=e55185e51b18d788e49fe8305fd73ef4470596b33fc2c1ceb304566b99c71a69 (from https://pypi.org/simple/numpy/) (requires-python:>=3.7). Command errored out with exit status 1: /usr/bin/python3 /tmp/pip-standalone-pip-i_1ms2rf/__env_pip__.zip/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-ducmhmws/overlay --no-warn-script-location -v --no-binary :all: --only-binary :none: -i https://pypi.org/simple -- 'setuptools<49.2.0' 'wheel<=0.35.1' 'Cython>=0.29.21,<3.0' Check the logs for full command output.
Using cached numpy-1.20.2.zip (7.8 MB)
Installing build dependencies ... error
WARNING: Discarding https://files.pythonhosted.org/packages/82/a8/1e0f86ae3f13f7ce260e9f782764c16559917f24382c74edfb52149897de/numpy-1.20.2.zip#sha256=878922bf5ad7550aa044aa9301d417e2d3ae50f0f577de92051d739ac6096cee (from https://pypi.org/simple/numpy/) (requires-python:>=3.7). Command errored out with exit status 1: /usr/bin/python3 /tmp/pip-standalone-pip-y3hxj5ln/__env_pip__.zip/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-228sn8g6/overlay --no-warn-script-location -v --no-binary :all: --only-binary :none: -i https://pypi.org/simple -- 'setuptools<49.2.0' 'wheel<=0.35.1' 'Cython>=0.29.21,<3.0' Check the logs for full command output.
Downloading numpy-1.20.1.zip (7.8 MB)
|ββββββββββββββββββββββββββββββββ| 7.8 MB 8.7 MB/s
Installing build dependencies ... error
WARNING: Discarding https://files.pythonhosted.org/packages/d2/48/f445be426ccd9b2fb64155ac6730c7212358882e589cd3717477d739d9ff/numpy-1.20.1.zip#sha256=3bc63486a870294683980d76ec1e3efc786295ae00128f9ea38e2c6e74d5a60a (from https://pypi.org/simple/numpy/) (requires-python:>=3.7). Command errored out with exit status 1: /usr/bin/python3 /tmp/pip-standalone-pip-wf7v7j36/__env_pip__.zip/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-9q2qcexu/overlay --no-warn-script-location -v --no-binary :all: --only-binary :none: -i https://pypi.org/simple -- 'setuptools<49.2.0' 'wheel<=0.35.1' 'Cython>=0.29.21,<3.0' Check the logs for full command output.
Downloading numpy-1.20.0.zip (8.0 MB)
|ββββββββββββββββββββββββββββββββ| 8.0 MB 5.0 MB/s
Installing build dependencies ... error
WARNING: Discarding https://files.pythonhosted.org/packages/c3/97/fd507e48f8c7cab73a9f002e52e15983b5636b4ac6cf69b83ae240324b44/numpy-1.20.0.zip#sha256=3d8233c03f116d068d5365fed4477f2947c7229582dad81e5953088989294cec (from https://pypi.org/simple/numpy/) (requires-python:>=3.7). Command errored out with exit status 1: /usr/bin/python3 /tmp/pip-standalone-pip-iklo2821/__env_pip__.zip/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-134vwo05/overlay --no-warn-script-location -v --no-binary :all: --only-binary :none: -i https://pypi.org/simple -- 'setuptools<49.2.0' 'wheel<=0.35.1' 'Cython>=0.29.21,<3.0' Check the logs for full command output.
Downloading numpy-1.19.5.zip (7.3 MB)
|ββββββββββββββββββββββββββββββββ| 7.3 MB 9.1 MB/s
Installing build dependencies ... error
...
I have pip (21.1.2), setuptools (57.0.0), wheel (0.36.2), cython (0.29.23), which should satisfy the requirements (?)
I also run with --no-binary :all:, because without it, the installation crashes faster when trying to build wheel.
Looks like there are no available packages for your architecture in the repo.
I suggest you running Alpine Linux container in Docker and installing Python + numpy inside it
I have no idea about that, but is there no way of getting a simple python installment on the device? Is there a way of creating numpy somehow for the OpenWRT? How about opencv? I see I can install it with opkg, but for python it isn't working.
Platform is x86_64 PCEngines APU 2, I have installed gcc, yes. Now I'm looking into having a virtual machine debian to build stuff for it. I'll look into the containerlink you gave me.
As it's been mentioned above, your problem is that there are no packages available for your platform.
It has to be compiled for your platform which requires gcc, python-dev and several dependencies that your package needs.
I've been on this path before and IMO running a lightweight Linux distro like Alpine Linux in Docker is the easiest way.
Sat Jun 26 11:14:54 2021 daemon.err dockerd[17263]: failed to start daemon: Devices cgroup isn't mounted
Sat Jun 26 11:15:42 2021 daemon.err modprobe: failed to find a module named aufs
Sat Jun 26 11:15:42 2021 daemon.err dockerd[17429]: time="2021-06-26T09:15:42.258204662Z" level=warning msg="failed to load plugin io.containerd.snapshotter.v1.devmapper" error="devmapper not configured"
Sat Jun 26 11:15:42 2021 daemon.err dockerd[17429]: time="2021-06-26T09:15:42.260466216Z" level=warning msg="could not use snapshotter devmapper in metadata plugin" error="devmapper not configured"
Sat Jun 26 11:15:42 2021 daemon.err dockerd[17429]: time="2021-06-26T09:15:42.371194445Z" level=warning msg="Your kernel does not support swap memory limit"
Sat Jun 26 11:15:42 2021 daemon.err dockerd[17429]: time="2021-06-26T09:15:42.371525970Z" level=warning msg="Your kernel does not support cgroup blkio weight"
Sat Jun 26 11:15:42 2021 daemon.err dockerd[17429]: time="2021-06-26T09:15:42.371593651Z" level=warning msg="Your kernel does not support cgroup blkio weight_device"
Sat Jun 26 11:15:43 2021 daemon.err dockerd[17429]: failed to start daemon: Devices cgroup isn't mounted
Well, I have currently been able to run 19.07.7, and I am having trouble compiling the 21 version (actually, I have never been able to compile any linux distribution, there is always some error somewhere, even if done according to guides and tutorials).
I will try the LXC method, after I get a working system up.
Because I cannot find a version for my device. I am also very noob when it comes linux stuff, let alone embedded stuff, so I have 99% no idea what I'm doing, just trying my best to follow instructions.