Open KOUKILEO opened 3 months ago
are you using an ubuntu image?
are you using an ubuntu image?
That's right. I use the one from the official link: Luckfox_Pico_Mini_Ubuntu_SDCard
Numpy is not supported yet, the same is true in buildroot, because the toolchain does not support it.
Numpy is not supported yet, the same is true in buildroot, because the toolchain does not support it.
What a shame... I bought this product to run LIBSVM. Hope your support comes soon.
@KOUKILEO , @luckfox-eng33
I'm more biased for alpine linux. I made a quick try in the alpine docker container, and numpy works perfectly. I don't have today a luckfox pico with me to test it on target, but 99.999 that will work. This is what I've done in alpine:
apk add python3
apk add py3-numpy
then I run one of the numpy examples - numpy_test1.py
# Importing the NumPy library with an alias 'np'
import numpy as np
# Creating a NumPy array 'nums' with provided values, including NaN (Not a Number)
nums = np.array([[3, 2, np.nan, 1],
[10, 12, 10, 9],
[5, np.nan, 1, np.nan]])
# Printing a message indicating the original array 'nums'
print("Original array:")
print(nums)
# Printing a message indicating finding the missing data (NaN) in the array using np.isnan()
# This function returns a boolean array of the same shape as 'nums', where True represents NaN values
print("\nFind the missing data of the said array:")
print(np.isnan(nums))
and everythink works, I get:
python numpy_test1.py
Original array:
[[ 3. 2. nan 1.]
[10. 12. 10. 9.]
[ 5. nan 1. nan]]
Find the missing data of the said array:
[[False False True False]
[False False False False]
[False True False True]]
I'm surprised that ubuntu don't have the compiled numpy for armv7 arch, are you sure? Try in ubuntu "apt install python3-numpy"! This opens another improvement, how to use docker to make an ubuntu container and transfer it to luckfox.
Anyway, tomorrow afternoon I should confirm that it is working on target.
@KOUKILEO , @luckfox-eng33 IT IS WORKING on target, I have one with alpine I could connect with ssh: This is the bash log:
lucky:~# apk add python3
fetch http://dl-cdn.alpinelinux.org/alpine/v3.19/main/armv7/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.19/community/armv7/APKINDEX.tar.gz
(1/13) Installing libbz2 (1.0.8-r6)
(2/13) Installing libexpat (2.6.0-r0)
(3/13) Installing libffi (3.4.4-r3)
(4/13) Installing gdbm (1.23-r1)
(5/13) Installing xz-libs (5.4.5-r0)
(6/13) Installing mpdecimal (2.5.1-r2)
(7/13) Installing libpanelw (6.4_p20231125-r0)
(8/13) Installing readline (8.2.1-r2)
(9/13) Installing sqlite-libs (3.44.2-r0)
(10/13) Installing python3 (3.11.8-r0)
(11/13) Installing python3-pycache-pyc0 (3.11.8-r0)
(12/13) Installing pyc (3.11.8-r0)
(13/13) Installing python3-pyc (3.11.8-r0)
Executing busybox-1.36.1-r15.trigger
OK: 60 MiB in 71 packages
lucky:~# apk add py3-numpy
(1/4) Installing libgfortran (13.2.1_git20231014-r0)
(2/4) Installing openblas (0.3.25-r0)
(3/4) Installing py3-numpy-pyc (1.25.2-r0)
(4/4) Installing py3-numpy (1.25.2-r0)
OK: 88 MiB in 75 packages
Then I execute the same python test file
python testnumpy.py
Original array:
[[ 3. 2. nan 1.]
[10. 12. 10. 9.]
[ 5. nan 1. nan]]
Find the missing data of the said array:
[[False False True False]
[False False False False]
[False True False True]]
Main message: you can use numpy, but not installed with pip, but with apk (or apt in ubuntu).. Try in ubuntu "apt install python3-numpy"
Does this solve your issue? I hope I could help.
@KOUKILEO
That's right. I use the one from the official link: Luckfox_Pico_Mini_Ubuntu_SDCard
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc - broken
CMake Error at /usr/share/cmake-3.22/Modules/CMakeTestCCompiler.cmake:69 (message):
The C compiler
"/usr/bin/cc"
is not able to compile a simple test program.
The default installed C/C++ compiler is broken, so you need to install g++ 9 and switch to this version. A 16GB or larger SD card is required for SWAP space. RNDIS network sharing must be enabled.
$ sudo mkswap /dev/mmcblk1p8
Setting up swapspace version 1, size = 54726455296 bytes
$ sudo swapon /dev/mmcblk1p8
[ 105.830584] Adding 53443804k swap on /dev/mmcblk1p8. Priority:-2 extents:1 across:53443804k SS
$ free -h
total used free shared buff/cache available
Mem: 33Mi 13Mi 2.0Mi 0.0Ki 17Mi 16Mi
Swap: 8.7Gi 15Mi 8.7Gi
$ sudo apt update
$ sudo apt install g++-9
$ sudo apt --reinstall install libc6-dev
$ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 1
$ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 2
$ sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 1
$ sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 2
$ gcc --version
gcc (Ubuntu 9.5.0-1ubuntu1~22.04) 9.5.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ g++ --version
g++ (Ubuntu 9.5.0-1ubuntu1~22.04) 9.5.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ python3 -m pip install ninja
I tried to install numpy on Luckfox Pico Mini B but he told me that ninja was missing, but I could not install it successfully.