1. Open Terminal (if it’s not already open)

2. Configure update-alternatives:

  • sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 40 sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 60
  • sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 10
  • sudo update-alternatives --config gcc
  • sudo update-alternatives --config g++

3. upgrade python 3.9

sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.5 1
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python2.7 2

sudo update-alternatives --config python3

--

--

  1. Creating a Virtual Environment

python3 -m venv <name_of_virtualenv>

eg.

python3 -m venv venv

2. Activating a Virtual Environment in the Terminal

Windows:

.\<name_of_virtualenv>\Scripts\activate

eg.

.\venv\Scripts\activate

Ubuntu:

source <name_of_virtualenv>\Scripts\activate

eg.

source venv\bin\activate

3. Deactivating a Virtual Environment

deactivate

--

--

Kang Wang

Process Mining, Data Scientist, Research Software Engineer, Climbing, ERP.