I am trying to setup virtualenvwrapper-win on a usb drive as part of a python development environment. In https://github.com/davidmarble/virtualenvwrapper-win it states:
Optional: Add an environment variable WORKON_HOME to specify the path to store environments. By default, this is %USERPROFILE%\Envs.
but doesn't explain how to do this. Could someone help with this?
My system python is at:
/f/python27/python
This is really simple. Start by changing directory into the root of our project directory, and then use the virtualenv command-line tool to create a new environment: $ mkdir myproject $ cd myproject $ virtualenv env New python executable in env/bin/python Installing setuptools, pip, wheel... done.
This is a port of Doug Hellmann's virtualenvwrapper to Windows batch scripts. The idea behind virtualenvwrapper is to ease usage of Ian Bicking's virtualenv, a tool for creating isolated Python virtual environments, each with their own libraries and site-packages.
AS lguananut said, you are asking how to set an environment variable. Take Win7 as example,
relaunch one command prompt, all commands like mkvirtualenv, workon will works.
If you prefer Powershell like me, you could also try the following code.
[Environment]::SetEnvironmentVariable("WORKON_HOME", "C:\Venv", "User")
[Environment]::SetEnvironmentVariable("PROJECT_HOME", "C:\Project", "User")
It will create two environment variables for your current user:
Paste the sample code in PowerShell window:
[Environment]::SetEnvironmentVariable("WORKON_HOME", "<Your-Virtual-Environment-Root>", "User")
[Environment]::SetEnvironmentVariable("PROJECT_HOME", "<Your-Project-Root>", "User")
It will populate the variables like
Hope it helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With