GuoXin Li's Blog

Virtual Environment For Different Projects

字数统计: 79阅读时长: 1 min
2018/04/20 Share

The virtualenv

  • First, install virtualenv on linux

    1
    $sudo apt-get install virtualenv
  • Second, create a virtualenv

    1
    $sudo virtualenv	youenvname
  • Then, activating an environment

    1
    2
    $cd youenvname
    $source ./bin/activate
  • Deactivaing an environment

    1
    $deactivate

Using conda to create an environment

  • First, install anaconda

    Anaconda Download

  • Creating an environment

    1
    $conda create -n yourenvname python=2.*/3.*
  • Activating

    1
    $source activate yourenvname
  • Deactivating

    1
    MacOs/linux: $source deactivate yourenvname; Windows: $deactivate yourenvname
  • Removoing

    1
    $conda remove -n yourenvname --all
CATALOG
  1. 1. The virtualenv
  2. 2. Using conda to create an environment