Dashboard compiling errors in VENV

Hi!
I am using ESPHome Dashboard in VENV in Debian 11.
Python version is 3.10.
ESPHome 2023.3.2

I see my projects in a browser, I can see their logs, download yaml files etc.
But when I press “Install” the compiling process ends with error such *** [.pioenvs/test/src/esphome/components/api/api_connection.cpp.o] sh: No such file or directory.
Esphome automatically creates .pioenvs/test/src/esphome/components/api/ folder, but it can’t create files.

If I run manually esphome compile test.yaml, it ends OK.

INFO Reading configuration /opt/esphome/config/test.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing test (board: esp01_1m; framework: arduino; platform: platformio/espressif8266 @ 3.2.0)
--------------------------------------------------------------------------------
HARDWARE: ESP8266 80MHz, 80KB RAM, 1MB Flash
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
Dependency Graph
|-- ESPAsyncTCP-esphome @ 1.2.3
|-- ESPAsyncWebServer-esphome @ 2.1.0
|   |-- ESPAsyncTCP-esphome @ 1.2.3
|   |-- Hash @ 1.0
|   |-- ESP8266WiFi @ 1.0
|-- DNSServer @ 1.1.1
|-- ESP8266WiFi @ 1.0
|-- ESP8266mDNS @ 1.2
|-- noise-c @ 0.1.4
|   |-- libsodium @ 1.10018.1
Compiling .pioenvs/test/src/esphome/components/api/api_connection.cpp.o
Compiling .pioenvs/test/src/esphome/components/api/api_frame_helper.cpp.o
Compiling .pioenvs/test/src/esphome/components/api/api_pb2.cpp.o
Compiling .pioenvs/test/src/esphome/components/api/api_pb2_service.cpp.o
Compiling .pioenvs/test/src/esphome/components/api/api_server.cpp.o
Compiling .pioenvs/test/src/esphome/components/api/list_entities.cpp.o
Compiling .pioenvs/test/src/esphome/components/api/proto.cpp.o
*** [.pioenvs/test/src/esphome/components/api/api_connection.cpp.o] sh: No such file or directory
Compiling .pioenvs/test/src/esphome/components/api/subscribe_state.cpp.o
*** [.pioenvs/test/src/esphome/components/api/api_frame_helper.cpp.o] sh: No such file or directory
*** [.pioenvs/test/src/esphome/components/api/api_pb2.cpp.o] sh: No such file or directory
*** [.pioenvs/test/src/esphome/components/api/api_pb2_service.cpp.o] sh: No such file or directory
*** [.pioenvs/test/src/esphome/components/api/api_server.cpp.o] sh: No such file or directory
*** [.pioenvs/test/src/esphome/components/api/list_entities.cpp.o] sh: No such file or directory
*** [.pioenvs/test/src/esphome/components/api/proto.cpp.o] sh: No such file or directory
*** [.pioenvs/test/src/esphome/components/api/subscribe_state.cpp.o] sh: No such file or directory
========================== [FAILED] Took 1.33 seconds ==========================