The message
error: externally-managed-environment × This environment is externally managed ╰─> To install Python packages system-wide, try apt install python3-xyz … create a virtual environment using python3 -m venv path/to/venv …
Affects: Python, WSL 2 (Windows Subsystem for Linux), ComfyUI, Open WebUI, vLLM
Why is this happening?
Current Linux distributions like Ubuntu and Debian mark their system Python as “externally managed” (PEP 668). Installing packages directly into the system with pip could break distribution programs. That’s why pip blocks this and requires a virtual environment.
How to fix it
- Create a virtual environment in the project folder:
python3 -m venv venv. - Activate it with
source venv/bin/activateand then install as usual, for examplepip install -r requirements.txt. - If the venv module is missing, install it through the package manager; on Ubuntu/Debian, use
sudo apt install python3-venvorsudo apt install python3-full. - For standalone command-line programs, you can use pipx instead (
sudo apt install pipx, thenpipx install <programm>); pipx creates the environment automatically.
Better not: Do not use --break-system-packages and do not use sudo pip install; in the worst case, that can damage your Linux system.
Set up from scratch again
If it still doesn’t work after that, a fresh setup step by step often helps:
- Set up and maintain ComfyUI on Windows
Desktop or Portable, where the models belong, sharing models with other programs, safely installing custom nodes, updates, startup options … - Your First Image with ComfyUI
Install Comfy Desktop, learn the interface, and create your first AI image with FLUX.2 [small] 4B or Z-Image Turbo. - Your First AI Video with LTX in ComfyUI
Use LTX-2.3 in ComfyUI to create short videos with sound from text or an image. Template, files, settings, and license.
Terms for this
Similar errors
- hipErrorNoBinaryForGpu: Unable to find code object for all current devices! (ROCm has no matching code for your AMD card)
- A module that was compiled using NumPy 1.x cannot be run in NumPy 2.x – a package does not match the installed NumPy version
- ImportError: DLL load failed while importing …: The specified module could not be found – a Python package is missing a Windows DLL
- No matching distribution found for torch (wrong Python version)
- No module named 'triton' on Windows (triton-windows missing)
Sources
Checked on Oct 21, 2026. Didn't help? Ask in the forum and name the graphics card, program, and the full message.