- 1 year ago
setting up virtualenvwrapper on windows
To set up virtualenvwrapper
on Windows, you can follow these steps:
Install Python: Download and install Python from the official Python website (https://www.python.org/downloads/) if you haven't already.
Install
virtualenvwrapper-win
:virtualenvwrapper-win
is a Windows-specific port ofvirtualenvwrapper
. Open a command prompt and run the following command to install it:bashpip install virtualenvwrapper-win
Set Environment Variables: Open the Start menu and search for "Edit the system environment variables". Click on the result to open the System Properties dialog.
Environment Variables: In the System Properties dialog, click on the "Environment Variables" button. This will open the Environment Variables dialog.
Add New Variables: In the User Variables section, click on the "New" button to add a new environment variable.
- Set the Variable name as
WORKON_HOME
. - Set the Variable value as the path where you want to store your virtual environments. For example,
C:\Users\YourUsername\Envs
.
- Set the Variable name as
Modify PATH Variable: In the System Variables section, scroll down and find the
Path
variable. Select it and click on the "Edit" button.Add Scripts Folder: In the Edit Environment Variable dialog, click on the "New" button and add the following path:
shell%USERPROFILE%\AppData\Roaming\Python\Scripts
Apply Changes: Click OK on all open windows to apply the changes.
Open a New Command Prompt: Close any open command prompts and open a new one to ensure the environment variables are loaded correctly.
Create and Activate a Virtual Environment: Now you can create and activate virtual environments using
virtualenvwrapper
commands. For example:To create a new virtual environment:
bashmkvirtualenv myenv
To activate a virtual environment:
bashworkon myenv
To deactivate the current virtual environment:
bashdeactivate
These steps should help you set up virtualenvwrapper
on Windows and start using it to manage your virtual environments conveniently.