Error: uv installation via pip failed with exit code 1 Error: Failed to install Python dependencies into penv

A head scratcher. I’ve successfully compiled with the same board you used and using both arduino and espidf platform options!
Latest software all round.

Note the compile for the arduino option took just about twice as that for the espidf.

No luck here. It’s frustrating with just updating HA and ESPHome, and now it won’t install anything on existing or new esp devices

I’ll give it another shot tomorrow and update this chat if I find a solution

Cleaning is invalid. Please try returning ESPHome 2025.6.0 first.

I fixed my ESPHome by using the steps from this site - Can't compile with esphome 2025.11.0 · Issue #12016 · esphome/esphome · GitHub

I ran the following commands to fix ESPHome:
Using the Terminal Addon, disable Protection Mode
docker exec -it addon_<hit tab 2x to auto complete the path> bash

pip install pip -U
pip install esphome==2025.11.4

I think that is the same one I sent you on earlier. You are replicating what should happen during install/upgrade for the workaround. I note the bug (for 2025.11.0) has been closed as there has been a new release since (2025.11.04).

Other option is to first backup your ESPHome yaml files, uninstall the ESPHome addon, make sure you restart twice, and then re-install, and restart twice. Try to compile again with a fresh copy of everything.

Advise if that makes a difference.

Consider that before rolling back to an earlier known working release.

1 Like

Right I just debugged this by installing strace into the esphome container.

esphome --version
Version: 2025.12.4

The problem is this command:

execve("/root/.platformio/penv/bin/python", ["/root/.platformio/penv/bin/python", "-m", "pip", "install", "uv>=0.1.0", "--quiet"], 0x5ad3d2d492e0 /* 29 vars */) = 0

Which when I run it without --quiet yields:

root@c4f363e449d6:/config# /root/.platformio/penv/bin/python -m pip install uv>=0.1.0
/root/.platformio/penv/bin/python: No module named pip

Which indeed there isn’t! pip isn’t installed in the penv environment for some reason.

You can fix it by running this:

/root/.platformio/penv/bin/python -m ensurepip

yielding

Looking in links: /tmp/tmpwderx_vy
Processing /tmp/tmpwderx_vy/pip-25.0.1-py3-none-any.whl
Installing collected packages: pip

Which then succeeds at installing uv.

I have a MITM proxy so then subsequent uv commands failed too –

root@c4f363e449d6:/config# /root/.platformio/penv/bin/uv pip install --python=/root/.platformio/penv/bin/python --upgrade https://github.com/pioarduino/platformio-core/archive/refs/tags/v6.1.18.zip "pyyaml>=6.0.2" "rich-click>=1.8.6" "zopfli>=0.2.2" "intelhex>=2.3.0" "rich>=14.0.0" "urllib3<2" "cryptography>=45.0.3" "certifi>=2025.8.3" "ecdsa>=0.19.1" "bitstring>=4.3.1" "reedsolo>=1.5.3,<1.8" "esp-idf-size>=2.0.0"
Using Python 3.12.10 environment at: /root/.platformio/penv
error: Request failed after 3 retries
  Caused by: Failed to fetch: `https://github.com/pioarduino/platformio-core/archive/refs/tags/v6.1.18.zip`
  Caused by: error sending request for url (https://github.com/pioarduino/platformio-core/archive/refs/tags/v6.1.18.zip)
  Caused by: client error (Connect)
  Caused by: invalid peer certificate: UnknownIssuer

(invisibly because --quiet is used too much IMO)

That was fixed by setting UV_NATIVE_TLS=true on my container deployment and SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt

But then I hit another error with the platform IO manager - this uses requests but it seems REQUESTS_CA_BUNDLE was no longer being respected from the environment. A little strace and the solution was just to put an RO mount over the certifi bundle:

openat(AT_FDCWD, "/root/.platformio/penv/lib/python3.12/site-packages/certifi/cacert.pem", O_RDONLY)

After that it actually worked! But this situation does seem a little ridiculous - some of it is obviously the MITM proxy but I think platform IO or something is dropping environment it should be respecting (and the proxy is a good thing - it takes pressure off the backend servers).

I don’t know what’s up with pip, but it should be an easy fix on the backend since those libraries did respect the TLS config I inject by default.

I had this problem with the latest ESPHome too (2025.11 and 2025.12).

Error: Failed to install Python dependencies (exit code: 1)
Error: Failed to install Python dependencies into penv

I just did esphome clean-all and it worked. Hopefully they fix it in the next version so this isn’t required.

1 Like

Same problem going from 2025.12.4 to 2025.12.5
Error: Failed to install Python dependencies (exit code: 1)
Error: Failed to install Python dependencies into penv

Clean all through the UI resulted in
Error: Failed to install Python dependencies (exit code: 2)
Error: Failed to install Python dependencies into penv

1 Like

Pressing ESPHOME → CLEAN ALL did the trick for me…

1 Like

Latest ESPHome 2026.1.1. esphome install .. still gives the same error when using Docker image.

Created pioarduino Python virtual environment using uv: /root/.platformio/penv
Error: uv installation failed with exit code 2
Error: Failed to install Python dependencies into penv

esphome clean-all doesn’t help. Looks like pip is missing and cleanup doesn’t add that.

/root/.platformio/penv/bin/python -m ensurepip command fixes it. However, you can’t run it first because this virtual env is missing before you run esphome itself once.