{"id":14064174,"url":"https://github.com/wbrandenburger/PSVirtualEnv","last_synced_at":"2025-07-29T17:32:29.261Z","repository":{"id":41903091,"uuid":"194220529","full_name":"wbrandenburger/PSVirtualEnv","owner":"wbrandenburger","description":"        The module PSVirtualEnv is a set of powershell extensions to Ian Bicking’s virtualenv tool in python. The module includes wrappers for creating and deleting virtual environments and otherwise managing your development workflow, making it easier to work on more than one project at a time without introducing conflicts in their dependencies.","archived":false,"fork":false,"pushed_at":"2020-10-06T04:56:51.000Z","size":23153,"stargazers_count":5,"open_issues_count":1,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-05-23T00:32:15.979Z","etag":null,"topics":["powershell","python","virtualenv-manager","virtualenvs","virtualenvwrapper","windows"],"latest_commit_sha":null,"homepage":"","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wbrandenburger.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-06-28T06:35:16.000Z","updated_at":"2023-10-12T09:51:30.000Z","dependencies_parsed_at":"2022-08-11T20:40:49.990Z","dependency_job_id":null,"html_url":"https://github.com/wbrandenburger/PSVirtualEnv","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wbrandenburger%2FPSVirtualEnv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wbrandenburger%2FPSVirtualEnv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wbrandenburger%2FPSVirtualEnv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wbrandenburger%2FPSVirtualEnv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wbrandenburger","download_url":"https://codeload.github.com/wbrandenburger/PSVirtualEnv/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228032924,"owners_count":17858917,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["powershell","python","virtualenv-manager","virtualenvs","virtualenvwrapper","windows"],"created_at":"2024-08-13T07:03:43.686Z","updated_at":"2024-12-04T02:31:17.566Z","avatar_url":"https://github.com/wbrandenburger.png","language":"PowerShell","funding_links":[],"categories":["PowerShell"],"sub_categories":[],"readme":"# [PSVirtualEnv](https://github.com/wbrandenburger/PSVirtualEnv)\n\n## Table of Contents\n\n- [PSVirtualEnv](#psvirtualenv)\n  - [Table of Contents](#table-of-contents)\n  - [General](#general)\n  - [Description](#description)\n    - [Origin](#origin)\n  - [Installation](#installation)\n  - [Dependencies](#dependencies)\n  - [Settings](#settings)\n  - [Available Commands](#available-commands)\n  - [Examples](#examples)\n    - [Creating virtual environments](#creating-virtual-environments)\n    - [Working with virtual environments](#working-with-virtual-environments)\n    - [Manage virtual environments](#manage-virtual-environments)\n  - [Authors/Contributors](#authorscontributors)\n    - [Author](#author)\n\n## General\n\nThe module PSVirtualEnv is in an experimental status and will be developed to achieve a stable version as fast as possible. The documentation of several functions has to be customized, due to the last changes.\n\n## Description\n\nThe module PSVirtualEnv is a set of PowerShell extensions to Ian Bicking’s virtualenv tool in python. The module includes wrappers for creating and deleting virtual environments and otherwise managing your development workflow, making it easier to work on more than one project at a time without introducing conflicts in their dependencies. Besides the management of virtual environments, the work with requirement files for installation, upgrade and deinstallation of packages is simplified, as well as dealing with offline installations.\n\n### Origin\n\nThis module is an extension of [virtualenvwrapper-powershell](https://github.com/regisf/virtualenvwrapper-powershell) and adds more functionality to manage virtual environments with the PowerShell.\n\n## Installation\n\nPSVirtualEnv is published to the Powershell Gallery and can be installed as follows:\n\n```powershell\nInstall-Module PSVirtualEnv\n```\n\nTo activate PSVirtualEnv and its autocompletion there is the need to dotsource in shell or in the local profile the output of `ActivateVirtualEnvAutocompletion`:\n\n```powershell\n. (ActivateVirtualEnvAutocompletion) # or in short '. (activate-venv)'\n```\n\n## Dependencies\n\nPSVirtualEnv needs a Python distribution (Version \u003e= 3) whose working directory has to be defined in environment variable `%PYTHONHOME%` or in the systems configuration file of PSVirtualEnv.\n\nThe following PowerShell module will be automatically installed:\n\n- [PSIni](https://github.com/lipkau/PsIni)\n\n## Settings\n\nPSVirtualEnv creates automatically a configuration file in folder `%USERPRFOFILE%\\.config\\psvirtualenv`. Moreover, PSVirtualEnv searches for configuration directories in environment variable `%XDG_CONFIG_HOME%` and `%XDG_CONFIG_DIRS%`. It is recommended to use a predefined configuration folder  across several projects.\n\nIn configuration file the working directory of a python distribution and an user defined folder for virtual environments can be specified. The default folder for the virtual environments is `%USERPRFOFILE%\\PSVirtualEnv`.\n\n```ini\n[user]\n\n; default path where virtual environments are located (path)\nvenv-work-dir = A:\\VirtualEnv\n\n; default download path for python packages (path)\nvenv-local-dir = %(venv-work-dir)s\\.temp\n\n; default path for the requirements (path)\nvenv-require-dir = %(venv-work-dir)s\\.require\n\n; default python distribution (path)\npython = %(PYTHONHOME)s\n\n; default editor for opening requirement files\ndefault-editor = code\n\n; optional arguments for editor when opening requirement files\neditor-arguments = --new-window\n```\n\nAn module specific extension of `PSIni` enables the exploitation of a reference fields `reference-field` inside a section, which can be applied via `%(reference-field)s`. This pattern will be replaced with the value defined in `reference-field`. If the defined reference field exists not in section, system's environment variables will be evaluated and, if any, used for replacing the pattern.\n\nThe other settings in section `psvirtualenv` are not relevant to standard user.\n\n## Available Commands\n\n| Command                  | Alias         | Description                                                                                 |\n|--------------------------|---------------|---------------------------------------------------------------------------------------------|\n| `Set-VirtualEnvLocation` | `cd-venv`     | Set the location of a virtual environment in folder `venv-work-dir`.                        |\n| `Install-VirtualEnv`     | `is-venv`     | Install or upgrade packages from command line or requirement files to virtual environments. |\n| `Find-Python`            |               | Find a path, where a python distribution might located.                                     |\n| `Get-VirtualEnv`         | `ls-venv`     | List all existing virtual environments in folder `venv-work-dir`.                           |\n| `Get-Requirement`        | `ls-venv-req` | Get the content of an existing requirement file in folder `require-work-dir`.               |\n| `New-VirtualEnv`         | `mk-venv`     | Create a virtual environment in folder `venv-work-dir`. .                                   |\n| `New-Requirement`        | `mk-venv-req` | Create requirement file an existing virtual environment with current installed packages .   |\n| `Remove-VirtualEnv`      | `rm-venv`     | Remove a specific virtual environment in folder `venv-work-dir`. .                          |\n| `Start-VirtualEnv`       | `sa-venv`     | Start a specific virtual environment in folder `venv-work-dir`.                             |\n| `Stop-VirtualEnv`        | `sp-venv`     | Stop current running virtual environment.                                                   |\n| `Write-VirtualEnvStatus` |               | Function to use in extensions for prompt, writing status of current virtual environment.    |\n| `New-Requirement`        | `mk-venv-req` | Create the requirement file of a specific virtual environment in folder `require-work-dir`. |\n| `Get-Requirement`        | `ls-venv-req` | Get the content of an existing requirement file in folder `require-work-dir`.               |\n| `Edit-Requirement`       | `ed-venv-req` | Edit the content of an existing requirement file in folder `require-work-dir`.              |\n| `Get-VirtualEnvConfig`   |               | Get the content of current module config file.                                              |\n| `Edit-VirtualEnvConfig`  |               | Edit the content of current module config file.                                             |\n\n## Examples\n\nGet an overview of all functions and aliases with powershell built-in command `Get-Command`:\n\n```log\nGet-Command -Module PSVirtualEnv\n\nCommandType     Name                                               Version    Source\n-----------     ----                                               -------    ------\nAlias           activate-venv                                      0.5.0      PSVirtualEnv\n...\nFunction        ActivateVirtualEnvAutocompletion                   0.5.0      PSVirtualEnv\n...\n```\n\nGet detailed information about module function with powershell built-in command `Get-Help`.\n\n### Creating virtual environments\n\nCreates a virtual environment in the predefined directory and install via a requirements file project related packages. All available requirement files can be accessed by autocompletion.\n\n```log\n  PS C:\\\u003e New-VirtualEnv -Name venv -Requirement \\requirements.txt # or in short 'mk-venv venv \\requirements.txt'\n\n  [PSVirtualEnv]::PROCESS: Creating new virtual environment 'venv'.\n  New python executable in C:\\Users\\User\\PSVirtualEnv\\venv\\Scripts\\python.exe\n  Installing setuptools, pip, wheel...\n  done.\n\n  [PSVirtualEnv]::SUCCESS: Virtual environment 'C:\\Users\\User\\PSVirtualEnv\\venv' was created.\n\n  [PSVirtualEnv]::PROCESS: Try to install missing packages from requirement file 'C:\\Users\\User\\PSVirtualEnv\\.require\\requirements.txt'.\n\n  [PSVirtualEnv]::SUCCESS: Packages from requirement file 'C:\\Users\\User\\PSVirtualEnv\\.require\\requirements.txt' were installed.\n\n\n  Name       Version Latest\n  ----       ------- ------\n  package    version\n  pip        19.2.3\n  setuptools 41.2.0\n  wheel      0.33.6\n```\n\n### Working with virtual environments\n\nStarts and stops a specific virtual environment in the predefined directory. All available virtual environments can be accessed by autocompletion.\n\n```log\n  PS C:\\\u003e Start-VirtualEnv -Name venv # or in short 'sa-venv venv'\n\n  [PSVirtualEnv]::SUCCESS: Virtual enviroment 'venv' was started.\n\n  [venv] PS C:\\\u003eStop-VirtualEnv # or in short 'sp-venv venv'\n\n  [PSVirtualEnv]::SUCCESS: Virtual enviroment 'venv' was stopped.\n\n  PS C:\\\u003e\n```\n\n### Manage virtual environments\n\nReturn information about all independent packages installed in the specified virtual environment and shows potentially newer versions. All available virtual environments can be accessed by autocompletion.\n\n```log\n  PS C:\\\u003e Get-VirtualEnv -Name venv # or in short ls-venv venv\n\n  Name       Version Latest\n  ----       ------- ------\n  Click      7.0\n  pip        19.2.3\n  setuptools 41.2.0\n  wheel      0.33.6\n```\n\n## Authors/Contributors\n\n### Author\n\n- [Wolfgang Brandenburger](https://github.com/wbrandenburger)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwbrandenburger%2FPSVirtualEnv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwbrandenburger%2FPSVirtualEnv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwbrandenburger%2FPSVirtualEnv/lists"}