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

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.

主站蜘蛛池模板: 托克逊县| 茶陵县| 庆元县| 长治县| 五指山市| 永州市| 裕民县| 洪雅县| 股票| 阿巴嘎旗| 乌兰察布市| 长泰县| 大英县| 来凤县| 永吉县| 紫阳县| 壤塘县| 绥化市| 贡觉县| 梧州市| 双流县| 东海县| 白河县| 金山区| 湾仔区| 常德市| 峨山| 萨嘎县| 凭祥市| 平乐县| 五河县| 临泽县| 隆化县| 龙泉市| 碌曲县| 永清县| 邹平县| 徐水县| 静乐县| 宣恩县| 来安县|