astral-sh / uv

An extremely fast Python package and project manager, written in Rust.
https://docs.astral.sh/uv
Apache License 2.0
20.35k stars 605 forks source link

Can't create virtual environment on ARMv7 Linux Musl #7529

Open patrick-5546 opened 19 hours ago

patrick-5546 commented 19 hours ago

This is what I get trying to create a virtual environment:

$ uv venv
  × Could not detect either glibc version nor musl libc version, at least one of which is required

Someone else also observed this issue here: https://github.com/astral-sh/uv/issues/1438, but it was not fixed by #1427

I used the installation script to install version 0.4.12

zanieb commented 19 hours ago

I wonder if we didn't port the fix when we added the code again?

cc @konstin

patrick-5546 commented 16 hours ago

My situation may be a bit of a unique case, as I am running Linux on an ARM processor on the DE1-SoC FPGA. Here is some more information about my system

$ cat /proc/version
Linux version 3.18.0 (altera@altera-Inspiron-5558) (gcc version 4.8.4 (Ubuntu/Linaro 4.8.4-2ubuntu1~14.04.1) ) #9 SMP Mon Aug 8 17:11:41 EDT 2016

$ lscpu
Architecture:          armv7l
Byte Order:            Little Endian
CPU(s):                2
On-line CPU(s) list:   0,1
Thread(s) per core:    1
Core(s) per socket:    2
Socket(s):             1

$ ldd --version
ldd (Ubuntu EGLIBC 2.15-0ubuntu10.23) 2.15
Copyright (C) 2012 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.
Written by Roland McGrath and Ulrich Drepper.

$ file .local/bin/uv
.local/bin/uv: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, stripped

$ musl
zsh: command not found: musl
patrick-5546 commented 16 hours ago

Looks like there isn't a pre-built python binary that can run on my system, as the gnu versions require glibc >= 2.17, and there is no musl version

$ wget https://github.com/indygreg/python-build-standalone/releases/download/20240909/cpython-3.11.10+20240909-armv7-unknown-linux-gnueabihf-install_only_stripped.tar.gz
...

$ tar -xzf cpython-3.11.10+20240909-armv7-unknown-linux-gnueabihf-install_only_stripped.tar.gz

$ ./python --version
./python: /lib/arm-linux-gnueabihf/libc.so.6: version `GLIBC_2.17' not found (required by /home/root/Downloads/python/bin/../lib/libpython3.11.so.1.0)
./python: /lib/arm-linux-gnueabihf/libc.so.6: version `GLIBC_2.16' not found (required by /home/root/Downloads/python/bin/../lib/libpython3.11.so.1.0)

Resources

Update

As a workaround, I was able to compile Python 3.8.20 from source (albeit with some failing and skipped tests) and use that to create a virtual environment

uv venv --python /usr/local/bin/python3.8