Skip to content

fix(env): add --system flag to uv pip install for environments without virtualenv#680

Open
CodeAgentCN wants to merge 1 commit into
PrimeIntellect-ai:mainfrom
CodeAgentCN:fix/uv-pip-install-system-flag
Open

fix(env): add --system flag to uv pip install for environments without virtualenv#680
CodeAgentCN wants to merge 1 commit into
PrimeIntellect-ai:mainfrom
CodeAgentCN:fix/uv-pip-install-system-flag

Conversation

@CodeAgentCN
Copy link
Copy Markdown

@CodeAgentCN CodeAgentCN commented May 24, 2026

Problem

Fixes PrimeIntellect-ai/community-environments#455

When running prime env install <owner>/<env-name> outside a virtualenv, uv pip install fails with:

error: No virtual environment found; run `uv venv` to create an environment, or pass `--system` to install into a non-virtual environment

This happens because uv, unlike pip, requires an explicit flag to install outside a virtualenv.

Solution

Added --system flag to all four uv pip install code paths in the env.py install functions:

  1. get_install_command() - used for wheel-based installs
  2. _install_single_environment() private env wheel path - used for private environment builds
  3. _build_install_command() - used for indexed environment installs
  4. install() command private env wheel path - used in the multi-env install flow

This allows prime env install to work in environments without a pre-existing virtualenv. When a virtualenv is already active, --system is a no-op (uv detects the venv and uses it).

Related


Note

Low Risk
Low risk: only adjusts generated uv pip install command args to support system installs; behavior for existing virtualenv users should remain effectively unchanged.

Overview
Fixes prime env install when run outside a virtualenv by appending --system to all uv pip install command paths (wheel URL installs, simple-index installs, and private-env wheel installs in both single- and multi-env flows). Pip-based install commands are unchanged.

Reviewed by Cursor Bugbot for commit 159f735. Bugbot is set up for automated code reviews on this repo. Configure here.

…t virtualenv

Fixes PrimeIntellect-ai/community-environments#455

When `prime env install` runs `uv pip install` outside a virtualenv,
uv refuses with:
  error: No virtual environment found; run `uv venv` to create an
  environment, or pass `--system` to install into a non-virtual
  environment

Adding --system allows the install to succeed when no venv exists.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix environments with git dependencies not installing from the hub

1 participant