Skip to content

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

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

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

Conversation

@CodeAgentCN
Copy link
Copy Markdown
Owner

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

…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