uv: uv installing for incorrect architecture (raspberry pi)

Summary

Running uv with any python version that is not 3.9 (system default) will result in a “Cannot open shared object file: No such file or directory” error.

Here are some logs that demonstrate the issue:

yucjo@raspberrypi ~/workspace/projects/ main
❯ uv -v run --python 3.9 python --version
DEBUG uv 0.7.2
DEBUG No project found; searching for Python interpreter
DEBUG Searching for Python 3.9 in virtual environments, managed installations, or search path
DEBUG Searching for managed installations at `/home/yucjo/.local/share/uv/python`
DEBUG Skipping incompatible managed installation `cpython-3.12.10-linux-armv7-gnueabi`
DEBUG Skipping incompatible managed installation `cpython-3.11.12-linux-armv7-gnueabi`
DEBUG Skipping incompatible managed installation `cpython-3.10.17-linux-armv7-gnueabi`
DEBUG Found `cpython-3.9.2-linux-armv7-gnu` at `/usr/bin/python3.9` (first executable in the search path)
DEBUG Using Python 3.9.2 interpreter at: /usr/bin/python3.9
DEBUG Running `python --version`
DEBUG Spawned child 20442 in process group 20439
Python 3.9.2
DEBUG Command exited with code: 0

yucjo@raspberrypi ~/workspace/projects/ main
❯ uv -v run --python 3.10 python --version
DEBUG uv 0.7.2
DEBUG No project found; searching for Python interpreter
DEBUG Searching for Python 3.10 in virtual environments, managed installations, or search path
DEBUG Searching for managed installations at `/home/yucjo/.local/share/uv/python`
DEBUG Skipping incompatible managed installation `cpython-3.12.10-linux-armv7-gnueabi`
DEBUG Skipping incompatible managed installation `cpython-3.11.12-linux-armv7-gnueabi`
DEBUG Found managed installation `cpython-3.10.17-linux-armv7-gnueabi`
DEBUG Failed to inspect Python interpreter from managed installations at `/home/yucjo/.local/share/uv/python/cpython-3.10.17-linux-armv7-gnueabi/bin/python3.10`
DEBUG Skipping bad interpreter at /home/yucjo/.local/share/uv/python/cpython-3.10.17-linux-armv7-gnueabi/bin/python3.10 from managed installations: Querying Python at `/home/yucjo/.local/share/uv/python/cpython-3.10.17-linux-armv7-gnueabi/bin/python3.10` failed with exit status exit status: 127

[stderr]
/home/yucjo/.local/share/uv/python/cpython-3.10.17-linux-armv7-gnueabi/bin/python3.10: error while loading shared libraries: /home/yucjo/.local/share/uv/python/cpython-3.10.17-linux-armv7-gnueabi/bin/../lib/libpython3.10.so.1.0: cannot open shared object file: No such file or directory

DEBUG Found `cpython-3.9.2-linux-armv7-gnu` at `/usr/bin/python3` (first executable in the search path)
DEBUG Skipping interpreter at `/usr/bin/python3` from first executable in the search path: does not satisfy request `3.10`
DEBUG Found `cpython-3.9.2-linux-armv7-gnu` at `/usr/bin/python` (search path)
DEBUG Skipping interpreter at `/usr/bin/python` from search path: does not satisfy request `3.10`
DEBUG Skipping bad interpreter at /home/yucjo/.local/share/uv/python/cpython-3.10.17-linux-armv7-gnueabi/bin/python3.10 from managed installations: Querying Python at `/home/yucjo/.local/share/uv/python/cpython-3.10.17-linux-armv7-gnueabi/bin/python3.10` failed with exit status exit status: 127

[stderr]
/home/yucjo/.local/share/uv/python/cpython-3.10.17-linux-armv7-gnueabi/bin/python3.10: error while loading shared libraries: /home/yucjo/.local/share/uv/python/cpython-3.10.17-linux-armv7-gnueabi/bin/../lib/libpython3.10.so.1.0: cannot open shared object file: No such file or directory

DEBUG Requested Python not found, checking for available download...
DEBUG Acquired lock for `/home/yucjo/.local/share/uv/python`
DEBUG Using request timeout of 30s
INFO Fetching requested Python...
DEBUG Released lock at `/home/yucjo/.local/share/uv/python/.lock`
error: Querying Python at `/home/yucjo/.local/share/uv/python/cpython-3.10.17-linux-armv7-gnueabi/bin/python3.10` failed with exit status exit status: 127

[stderr]
/home/yucjo/.local/share/uv/python/cpython-3.10.17-linux-armv7-gnueabi/bin/python3.10: error while loading shared libraries: /home/yucjo/.local/share/uv/python/cpython-3.10.17-linux-armv7-gnueabi/bin/../lib/libpython3.10.so.1.0: cannot open shared object file: No such file or directory

The libraries are clearly present:

yucjo@raspberrypi ~/workspace/projects/ main
❯ l  /home/yucjo/.local/share/uv/python/cpython-3.10.17-linux-armv7-gnueabi/bin/../lib/libpython3.10.so.1.0
-rwxr-xr-x 1 yucjo yucjo 21M May  5 00:29 /home/yucjo/.local/share/uv/python/cpython-3.10.17-linux-armv7-gnueabi/bin/../lib/libpython3.10.so.1.0

One thing I’m noticing, is that this is an aarch64 machine, however uv is downloading the armv7 executables. Running python 3.13 will download the armv7 version, yielding the same error:

yucjo@raspberrypi ~/workspace/projects/ main
❮ uv -v run --python 3.13 python --version
DEBUG uv 0.7.2
DEBUG No project found; searching for Python interpreter
DEBUG Searching for Python 3.13 in virtual environments, managed installations, or search path
DEBUG Searching for managed installations at `/home/yucjo/.local/share/uv/python`
DEBUG Skipping incompatible managed installation `cpython-3.12.10-linux-armv7-gnueabi`
DEBUG Skipping incompatible managed installation `cpython-3.11.12-linux-armv7-gnueabi`
DEBUG Skipping incompatible managed installation `cpython-3.10.17-linux-armv7-gnueabi`
DEBUG Found `cpython-3.9.2-linux-armv7-gnu` at `/usr/bin/python3` (first executable in the search path)
DEBUG Skipping interpreter at `/usr/bin/python3` from first executable in the search path: does not satisfy request `3.13`
DEBUG Found `cpython-3.9.2-linux-armv7-gnu` at `/usr/bin/python` (search path)
DEBUG Skipping interpreter at `/usr/bin/python` from search path: does not satisfy request `3.13`
DEBUG Requested Python not found, checking for available download...
DEBUG Acquired lock for `/home/yucjo/.local/share/uv/python`
DEBUG Using request timeout of 30s
INFO Fetching requested Python...
DEBUG Downloading https://github.com/astral-sh/python-build-standalone/releases/download/20250409/cpython-3.13.3%2B20250409-armv7-unknown-linux-gnueabi-install_only_stripped.tar.gz
DEBUG Extracting cpython-3.13.3-20250409-armv7-unknown-linux-gnueabi-install_only_stripped.tar.gz to temporary location: /home/yucjo/.local/share/uv/python/.temp/.tmpZnA1Xt
Downloading cpython-3.13.3-linux-armv7-gnueabi (download) (17.0MiB)
 Downloading cpython-3.13.3-linux-armv7-gnueabi (download)
DEBUG Moving /home/yucjo/.local/share/uv/python/.temp/.tmpZnA1Xt/python to /home/yucjo/.local/share/uv/python/cpython-3.13.3-linux-armv7-gnueabi
DEBUG Released lock at `/home/yucjo/.local/share/uv/python/.lock`
error: Querying Python at `/home/yucjo/.local/share/uv/python/cpython-3.13.3-linux-armv7-gnueabi/bin/python3.13` failed with exit status exit status: 127

[stderr]
/home/yucjo/.local/share/uv/python/cpython-3.13.3-linux-armv7-gnueabi/bin/python3.13: error while loading shared libraries: /home/yucjo/.local/share/uv/python/cpython-3.13.3-linux-armv7-gnueabi/bin/../lib/libpython3.13.so.1.0: cannot open shared object file: No such file or directory

Platform

Raspbian GNU/Linux 11 (bullseye) aarch64

Version

uv 0.7.2

Python version

3.12.10

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Comments: 19 (6 by maintainers)

Most upvoted comments

More investigation:

  • /proc/sys/kernel/arch is aarch64
  • /proc/cpuinfo has Features: fp asimd evtstrm crc32 cpuid

std::env::const::ARCH will be "arm", as it’s set at compile time and roughly follows the target tuple.

So something like if features.contains("vfp") || features.contains("fp") in https://github.com/astral-sh/uv/blob/90a7208a73a2050fe06ff37db11bbc60a7919ef9/crates/uv-python/src/cpuinfo.rs#L19 should work.

I can test this later today when that machine is free

Can you share uv python install 3.12 -v and uv python list 3.12 -v?

We have the same problem with a Pi4 on Raspberry Pi OS (Legacy - bullseye). If you need more details let me know:


pi@raspberrypi: $ uname -a
Linux raspberrypi 6.12.16-v8+ #1859 SMP PREEMPT Mon Feb 24 13:14:16 GMT 2025 aarch64 GNU/Linux

pi@raspberrypi: $ file $(readlink -f $(which python3))
/usr/bin/python3.13: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, BuildID[sha1]=262f1bbb4f95658f180197977ded7f920810fad6, for GNU/Linux 3.2.0, with debug_info, not stripped

pi@raspberrypi: $ file $(which uv)
/home/pi/.local/bin/uv: ELF 32-bit LSB pie executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.101, stripped


$ uv python list
cpython-3.14.0a6-linux-armv7-gnueabi                 <download available>
cpython-3.14.0a6+freethreaded-linux-armv7-gnueabi    <download available>
cpython-3.13.3-linux-armv7-gnueabi                   <download available>
cpython-3.13.3+freethreaded-linux-armv7-gnueabi      <download available>
cpython-3.13.0-linux-armv7-gnu                       /usr/bin/python3.13
cpython-3.13.0-linux-armv7-gnu                       /usr/bin/python3 -> /etc/alternatives/python3
cpython-3.13.0-linux-armv7-gnu                       /usr/bin/python -> /etc/alternatives/python
cpython-3.12.10-linux-armv7-gnueabi                  <download available>
cpython-3.11.12-linux-armv7-gnueabi                  <download available>
cpython-3.10.17-linux-armv7-gnueabi                  <download available>
cpython-3.9.22-linux-armv7-gnueabi                   <download available>
cpython-3.9.2-linux-armv7-gnu                        /usr/bin/python3.9

Installing 3.13.3 works, but then trying to create a venv with it, fails.

I think he meant --all.