Skip to content

Instantly share code, notes, and snippets.

@mevangelista-alvarado
Last active July 13, 2018 21:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mevangelista-alvarado/8ee2fd663e7446e543fc04eacce0f303 to your computer and use it in GitHub Desktop.
Save mevangelista-alvarado/8ee2fd663e7446e543fc04eacce0f303 to your computer and use it in GitHub Desktop.
Small description for use virtual environment for OS X and Linux

Virtual Environment

Create

To start, first create a directory

    mkdir directory_name

Enter the directory

    cd directory_name

Create a virtualenv

    python3 -m venv venv_name

Remark: The name of your virtual environment is myvenv_name

Activate

To activate a your virtual environment, do the following

    cd venv_name
    cd bin
    source activate

Remark: You can activate your virtual enviroment in a single command

    source venv_name/bin/activate

To know that your virtual environment was successfully activated, the following should appear on the console

    (venv_name) ~/home/directory_name/venv_name/bin

Remark: Do not forget to return to the directory directory_name with cd ..

Deactivate

To deactivate a your virtual environment, do the following

    (venv_name) ~/home/directory_name/venv_name deactivate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment