Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 1579

Python • how do you install numpy in venv?

$
0
0
Pi Zero W, Python 3, Bookworm

In theory it should be trivial:

Code:

python3 -m venv wssource ~/ws/bin/activatepip install numpy
But it doesn't work. Instead of downloading ready code my pi tries to compile everything, it takes days (not sure how long actually, after 24h I had to leave for three days), and eventually it fails:

Code:

        Installing backend dependencies: still running...        Installing backend dependencies: still running...        Installing backend dependencies: finished with status 'done'        Preparing metadata (pyproject.toml): started        Preparing metadata (pyproject.toml): finished with status 'done'      Collecting ninja>=1.8.2        Using cached https://www.piwheels.org/simple/ninja/ninja-1.11.1.4-py3-none-linux_armv6l.whl (134 kB)      Building wheels for collected packages: patchelf        Building wheel for patchelf (pyproject.toml): started        Building wheel for patchelf (pyproject.toml): finished with status 'error'        error: subprocess-exited-with-error        × Building wheel for patchelf (pyproject.toml) did not run successfully.        │ exit code: 1        ╰─> [29 lines of output]            *** scikit-build-core 0.11.5 using CMake 4.0.3 (wheel)            *** Configuring CMake...            loading initial cache file build/py3-none-linux_armv6l/CMakeInit.txt            -- The C compiler identification is GNU 12.2.0            -- The CXX compiler identification is GNU 12.2.0            -- Detecting C compiler ABI info            -- Detecting C compiler ABI info - done            -- Check for working C compiler: /usr/bin/arm-linux-gnueabihf-gcc - skipped            -- Detecting C compile features            -- Detecting C compile features - done            -- Detecting CXX compiler ABI info            -- Detecting CXX compiler ABI info - done            -- Check for working CXX compiler: /usr/bin/arm-linux-gnueabihf-g++ - skipped            -- Detecting CXX compile features            -- Detecting CXX compile features - done            -- Configuring done (9.5s)            -- Generating done (0.1s)            -- Build files have been written to: /tmp/pip-install-b61tw2r9/patchelf_441f840ce8c346368ac9be1b8c3c43a5/build/py3-none-linux_armv6l            *** Building project with Unix Makefiles...            [ 11%] Creating directories for 'build_patchelf'            [ 22%] No download step for 'build_patchelf'            [ 33%] No update step for 'build_patchelf'            [ 44%] Performing patch step for 'build_patchelf'            ./bootstrap.sh: 2: autoreconf: not found            gmake[2]: *** [CMakeFiles/build_patchelf.dir/build.make:114: build_patchelf-prefix/src/build_patchelf-stamp/build_patchelf-patch] Error 127            gmake[1]: *** [CMakeFiles/Makefile2:90: CMakeFiles/build_patchelf.dir/all] Error 2            gmake: *** [Makefile:136: all] Error 2            *** CMake build failed            [end of output]
(earlier it was failing with a message about missing OpenSSL development package, but I installed the package and it gets past that step).

Installing global version of numpy with "sudo apt install python3-numpy" works nicely, but is of no use in venv.

Any ideas/suggestions?

Statistics: Posted by Bzdurek — Thu Aug 14, 2025 8:34 pm



Viewing all articles
Browse latest Browse all 1579

Trending Articles