Virtualenv setting guide

Guides how to set up virtualenv environment to run Python Package.

Contents

๐Ÿ’ป Install Python, python-dev

  • Refer to the Installation Guide for how to install Python.
  • Install python-dev, python-distutils according to the python version you are using.
    $ sudo apt-get install python3.7 python3-pip python3.7-dev python3.7-distutils
    

๐Ÿ“‹ Create and activate virtualenv

See the Python virtaulenv page for details.

$ pip3 install virtualenv
$ virtualenv -p /usr/bin/python3.7 venv
$ source venv/bin/activate

โŒจ๏ธ Virtualenv commands

Command description command
Create a virtual environment. virtualenv -p [python_version] [env_name]
Activate a virtual environment. source [env_name]/bin/activate
Deactivate a virtual environment deactivate