官术网_书友最值得收藏!

Installing and using the virtual environment

Now we will see how to install the virtual environment and how to activate it. 

To install the virtual environment on Linux, perform the following steps:

  1. First check whether pip is installed or not. We are going to install pip for python3
sudo apt install python3-pip
  1. Install the virtual environment using pip3:
sudo pip3 install virtualenv
  1. Now we will create the virtual environment. You can give it any name; I have called it pythonenv:
virtualenv pythonenv
  1. Activate your virtual environment:
source venv/bin/activate
  1. After your work is done, you can deactivate virtualenv by using following command:
deactivate

In Windows, run the pip install virtualenv command to install the virtual environment. The steps for installing virtualenv are same as with Linux.

主站蜘蛛池模板: 汉寿县| 阿克苏市| 衡东县| 前郭尔| 定州市| 光山县| 天全县| 西乡县| 江西省| 柘城县| 石狮市| 临沂市| 遂溪县| 广饶县| 怀仁县| 托里县| 新邵县| 青海省| 蓬安县| 隆安县| 丽水市| 布尔津县| 姚安县| 古交市| 彭阳县| 福贡县| 长乐市| 石楼县| 镇康县| 车致| 栾川县| 潮安县| 广平县| 南平市| 肥城市| 竹山县| 西和县| 榆社县| 孝感市| 苍梧县| 通山县|