- Mastering Python Scripting for System Administrators
- Ganesh Sanjiv Naik
- 128字
- 2021-07-02 14:00:17
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:
- First check whether pip is installed or not. We are going to install pip for python3:
sudo apt install python3-pip
- Install the virtual environment using pip3:
sudo pip3 install virtualenv
- Now we will create the virtual environment. You can give it any name; I have called it pythonenv:
virtualenv pythonenv
- Activate your virtual environment:
source venv/bin/activate
- 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.
推薦閱讀
- Modular Programming with Python
- Spring Boot開(kāi)發(fā)與測(cè)試實(shí)戰(zhàn)
- Learn Type:Driven Development
- Visual FoxPro程序設(shè)計(jì)教程(第3版)
- Practical Internet of Things Security
- ASP.NET動(dòng)態(tài)網(wǎng)頁(yè)設(shè)計(jì)教程(第三版)
- 零基礎(chǔ)學(xué)單片機(jī)C語(yǔ)言程序設(shè)計(jì)
- Python數(shù)據(jù)結(jié)構(gòu)與算法(視頻教學(xué)版)
- 數(shù)據(jù)結(jié)構(gòu)習(xí)題解析與實(shí)驗(yàn)指導(dǎo)
- Python High Performance Programming
- Mastering Git
- Java自然語(yǔ)言處理(原書(shū)第2版)
- Developer,Advocate!
- 前端程序員面試算法寶典
- IBM DB2 9.7 Advanced Application Developer Cookbook