uv-iso-env

raw JSON →
1.0.43 verified Fri May 01 auth: no python

A tool for creating isolated Python environments using uv. It provides a wrapper around uv to manage ephemeral environments for testing or running scripts with specific dependencies. Current version 1.0.43, actively maintained on PyPI.

pip install uv-iso-env
error ModuleNotFoundError: No module named 'uv_iso_env'
cause Wrong package name in pip install (e.g., installed 'iso-env' instead of 'uv-iso-env').
fix
Run: pip install uv-iso-env
error AttributeError: module 'uv_iso_env' has no attribute 'iso_env2'
cause Using an outdated import path 'iso_env2' from a previous version.
fix
Use: from uv_iso_env import iso_env
breaking On PyPI, the package is 'uv-iso-env' but the import module uses underscores: 'uv_iso_env'.
fix Install with 'pip install uv-iso-env' and import as 'from uv_iso_env import iso_env'.
gotcha The function name 'iso_env' differs from the package name. Do not look for a function named 'uv_iso_env'.
fix Use 'from uv_iso_env import iso_env'.

Creates an isolated uv-managed environment, installs specified requirements, and executes a command within it.

from uv_iso_env import iso_env

# Create an isolated environment and run a command
result = iso_env(["python", "-c", "print('hello')"], requirements=["requests>=2.28"])
print(result.stdout.decode() if result.stdout else result.stderr.decode())