- 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.
推薦閱讀
- HTML5+CSS3王者歸來
- C語言程序設計基礎與實驗指導
- 自然語言處理Python進階
- 深入淺出Serverless:技術原理與應用實踐
- 大模型RAG實戰:RAG原理、應用與系統構建
- SQL Server從入門到精通(第3版)
- Learning AWS
- HTML5開發精要與實例詳解
- Web程序設計:ASP.NET(第2版)
- Mudbox 2013 Cookbook
- Parallel Programming with Python
- Backbone.js Patterns and Best Practices
- JSP應用與開發技術(第3版)
- Improving your Penetration Testing Skills
- 計算機常用算法與程序設計教程(第2版)