📁
EdmundHee
  • Edmund's How to
  • Python
    • Virtual Environment
      • Setup for Windows
      • Setup for Mac
      • How to use VirtualEnvWrapper
  • Git
    • Setup Git Environment
      • Setup Git for Windows
      • Setup Git for Mac
    • Github's How-to
      • Create a repository
      • Repository Branch
      • Update Repository
  • AWS
    • EC2
      • [Raw] EC2 - Recovery Instance
  • Web Development
    • NodeJS
Powered by GitBook
On this page
  • Location of VirtualEnv
  • Creating VirtualEnv
  • Exit from VirtualEnv
  • Activate VirtualEnv
  • Remove VirtualEnv
  • List all VirtualEnv

Was this helpful?

  1. Python
  2. Virtual Environment

How to use VirtualEnvWrapper

Location of VirtualEnv

Mac OS : ~/.virtualenvs

Windows OS : C:\Users\<User Name>\Envs

Creating VirtualEnv

For Windows Users

Please search for the full location path for python.exe, the default location should be inside

C:\Users\<USERNAME>\AppData\Local\Programs\Python\Python3X\python.exe

We will need to specify the python path when creating the virtualenv. Command to create virtualenv is as below

mkvirtualenv <VIRTUALENV NAME> -p </PATH/TO/python.exe>

Windows OS

Example of executing the command ( run the command in command prompt/Cmder)

mkvirtualenv helloworld-py3 -p C:\Users\<USERNAME>\AppData\Local\Programs\Python\Python3X\python.exe

Mac OS

mkvirtualenv helloworld-py3 -p python3.7

Once the virtualenv is created, you should be able to see the virtualenv name in bracket at the left side inside your command prompt/Cmder/Terminal.

Exit from VirtualEnv

In order to exit from active virtualenv, run the following command

deactivate

Activate VirtualEnv

Start and activate a virtualenv

workon <VIRTUALENV NAME>

Remove VirtualEnv

Delete virtualenv, you won't be able to remove the virtualenv if it's still active.

rmvirtualenv <VIRTUALENV NAME>

List all VirtualEnv

List out all the virtualenv created in your laptop

lsvirtualenv
PreviousSetup for MacNextSetup Git Environment

Last updated 5 years ago

Was this helpful?