Skip to content

Virtual Environment Wrapper for PowerShell

License

Notifications You must be signed in to change notification settings

schroedjan/PoshVenv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

PoshVenv - A PowerShell native Python Virtual Environment Manager

PoshVenv is a Powershell native implementation to manage Pythin Virtual Environments.

Installation

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)

Usage

Create a new virtual environment

PoshVenv create <env_name>

Creates a new virtual environment with the specified name.

Activate a virtual environment

PoshVenv activate <env_name>

Activates the specified virtual environment.

Deactivate the current virtual environment

PoshVenv deactivate

Deactivates the currently active virtual environment.

List all virtual environments

PoshVenv list

Lists all available virtual environments.

Remove a virtual environment

PoshVenv remove <env_name>

Removes the specified virtual environment.

Automatic venv activation

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.

Configuration

You can configure PoshVenv with command line parameters for each call or environment variables globally. Parameters take precedence over environment variables.

PoshVenv Home

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.

Python Binary

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.

About

Virtual Environment Wrapper for PowerShell

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published