PoshVenv is a Powershell native implementation to manage Pythin Virtual Environments.
Just clone the repository and make the PoshVenv.ps1 available in your PATH.
For example, you can create a symlink to the script in a folder that is in your PATH.
New-Item <yourPath/Poshvenv.ps1> -ItemType SymbolicLink -Value <pathToPoshVenvRepo/PoshVenv.ps1>To enable automatic venv activation, also add the following line to your Powershell profile:
Invoke-Expression(PoshVenv init)PoshVenv create <env_name>Creates a new virtual environment with the specified name.
PoshVenv activate <env_name>Activates the specified virtual environment.
PoshVenv deactivateDeactivates the currently active virtual environment.
PoshVenv listLists all available virtual environments.
PoshVenv remove <env_name>Removes the specified virtual environment.
Make sure to follow the installation instructions to enable automatic venv activation.
To configure automatic venv activation, add a .poshvenvfile into the root of your project. The file should contain the name of the virtual environment to activate.
Once you change your directory into the folder, the venv will be activated automatically. Leaving the folder will deactivate the venv.
Search happens recursively from the current directory to the root of the drive.
You can configure PoshVenv with command line parameters for each call or environment variables globally. Parameters take precedence over environment variables.
The home path where virtual environments are stored. Defaults to $env:USERPROFILE/.poshvenv.
You can set $env:POSHVENV_HOME or pass the -h|--home parameter to configurre the home path.
The python binary to use. Default to python.
You can set $env:POSHVENV_PYTHON_BIN or pass the -p|--python parameter to configure the python binary.