`install_executorch.sh` fails in a fresh uv virtual environment: `No module named pip`

Abierto
#24,417 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@mshr-h ya está trabajando en esto.

Desde el 2/11/2026.

  • #24419 de @mshr-h — abierto

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
45/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
python, shell
Área
build-system

Línea de trabajo

Start with install_executorch.sh, then install_executorch.py (the main function around line 216) and install_utils.py (python_is_compatible, around line 398). Those spots call python -m pip install packaging directly. Reproduce by creating a venv with uv venv (no pip) and running the installer. Done means the installer completes in that venv when uv is on PATH, with the pip-only calls falling back to uv pip or an equivalent.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

🐛 Describe the bug

Installing ExecuTorch from source fails in a venv created with uv venv.

uv does not install pip into venv by default. However, the install_executorch.sh invoke python -m pip directly, even when uv is available on PATH.

Steps to reproduce

git clone --recurse-submodules https://github.com/pytorch/executorch.git
cd executorch

uv venv --python 3.12
source .venv/bin/activate

./install_executorch.sh --editable --verbose

Actual behavior

The installer exits with:

/home/user/data/project/executorch-work/3rdparty/executorch/.venv/bin/python3: No module named pip
Traceback (most recent call last):
  File "/home/user/data/project/executorch-work/3rdparty/executorch/install_utils.py", line 398, in python_is_compatible
    import packaging
ModuleNotFoundError: No module named 'packaging'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/user/data/project/executorch-work/3rdparty/executorch/./install_executorch.py", line 264, in <module>
    main(sys.argv[1:])
  File "/home/user/data/project/executorch-work/3rdparty/executorch/./install_executorch.py", line 216, in main
    if not python_is_compatible():
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/data/project/executorch-work/3rdparty/executorch/install_utils.py", line 400, in python_is_compatible
    subprocess.run(
  File "/home/user/.local/share/uv/python/cpython-3.12.13-linux-aarch64-gnu/lib/python3.12/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/home/user/data/project/executorch-work/3rdparty/executorch/.venv/bin/python3', '-m', 'pip', 'install', 'packaging']' returned non-zero exit status 1.

The first failure occurs during the Python compatibility check, when the installer attempts to bootstrap packaging:

python -m pip install packaging

Installing packaging beforehand with uv is insufficient, since subsequent dependency and package installation steps also invoke pip directly.

Expected behavior

The installer should work in a default uv venv without requiring users to install pip manually. When pip is unavailable and uv is on PATH, it should use uv to install dependencies into the active Python environment.

Workaround

Manually install pip before running the installer:

uv pip install pip
./install_executorch.sh --editable --verbose

Related: #15907

Versions

PyTorch version: N/A
Is debug build: N/A
CUDA used to build PyTorch: N/A
ROCm SDK used to build PyTorch: N/A
HIP used to build PyTorch: N/A

OS: Ubuntu 24.04.5 LTS (aarch64)
GCC version: (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0
Clang version: Could not collect
CMake version: version 3.28.3
Libc version: glibc-2.39

Python version: 3.12.13 (main, Apr 14 2026, 14:26:08) [Clang 22.1.3 ] (64-bit runtime)
Python platform: Linux-7.0.0-1024-nvidia-aarch64-with-glibc2.39
Is CUDA available: N/A
CUDA runtime version: 13.0.88
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: GPU 0: NVIDIA GB10
Nvidia driver version: 580.178.04
cuDNN version: Probably one of the following:
/usr/lib/aarch64-linux-gnu/libcudnn.so.9.27.0
/usr/lib/aarch64-linux-gnu/libcudnn_adv.so.9.27.0
/usr/lib/aarch64-linux-gnu/libcudnn_cnn.so.9.27.0
/usr/lib/aarch64-linux-gnu/libcudnn_engines_precompiled.so.9.27.0
/usr/lib/aarch64-linux-gnu/libcudnn_engines_runtime_compiled.so.9.27.0
/usr/lib/aarch64-linux-gnu/libcudnn_engines_tensor_ir.so.9.27.0
/usr/lib/aarch64-linux-gnu/libcudnn_ext.so.9.27.0
/usr/lib/aarch64-linux-gnu/libcudnn_graph.so.9.27.0
/usr/lib/aarch64-linux-gnu/libcudnn_heuristic.so.9.27.0
/usr/lib/aarch64-linux-gnu/libcudnn_ops.so.9.27.0
Is XPU available: N/A
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: N/A
Caching allocator config: N/A

CPU:
Architecture: aarch64
CPU op-mode(s): 64-bit
Byte Order: Little Endian
CPU(s): 20
On-line CPU(s) list: 0-19
Vendor ID: ARM
Model name: Cortex-X925
Model: 1
Thread(s) per core: 1
Core(s) per socket: 10
Socket(s): 1
Stepping: r0p1
Frequency boost: disabled
CPU(s) scaling MHz: 100%
CPU max MHz: 3900.0000
CPU min MHz: 1378.0000
BogoMIPS: 2000.00
Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh bti ecv afp wfxt
Model name: Cortex-A725
Model: 1
Thread(s) per core: 1
Core(s) per socket: 10
Socket(s): 1
Stepping: r0p1
CPU(s) scaling MHz: 100%
CPU max MHz: 2808.0000
CPU min MHz: 338.0000
BogoMIPS: 2000.00
Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh bti ecv afp wfxt
L1d cache: 1.3 MiB (20 instances)
L1i cache: 1.3 MiB (20 instances)
L2 cache: 25 MiB (20 instances)
L3 cache: 24 MiB (2 instances)
NUMA node(s): 1
NUMA node0 CPU(s): 0-19
Vulnerability Gather data sampling: Not affected
Vulnerability Ghostwrite: Not affected
Vulnerability Indirect target selection: Not affected
Vulnerability Itlb multihit: Not affected
Vulnerability L1tf: Not affected
Vulnerability Mds: Not affected
Vulnerability Meltdown: Not affected
Vulnerability Mmio stale data: Not affected
Vulnerability Old microcode: Not affected
Vulnerability Reg file data sampling: Not affected
Vulnerability Retbleed: Not affected
Vulnerability Spec rstack overflow: Not affected
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1: Mitigation; __user pointer sanitization
Vulnerability Spectre v2: Mitigation; CSV2, BHB
Vulnerability Srbds: Not affected
Vulnerability Tsa: Not affected
Vulnerability Tsx async abort: Not affected
Vulnerability Vmscape: Not affected

Versions of relevant libraries:
[pip3] Could not collect
[conda] Could not collect

Lenguaje dominante
Python
Estrellas
5.1k
Forks
1.2k
Merge medio
1 d 18 h
PR fusionados (30 d)
668

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de pytorch/executorch

Todos los issues de pytorch/executorch

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.