程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

Win installing Python virtual environment is so simple

編輯:Python

establish Win Systematic python A virtual environment

What is the use of virtual environment

stay python In development , We may encounter a situation , That is, the current project depends on a certain version , But another project depends on another version , This can lead to dependency conflicts , and virtualenv That's how it works ,virtualenv By creating a virtualized python Running environment , Install the dependencies we need , Different projects do not interfere with each other , As shown below .

Installing a virtual environment

 # win+r Input cmd Open console 
pip install virtualenv # Installing a virtual environment 

Creating a virtual environment

 # Switch the path to the virtual environment you want to create 
virtualenv Env_name # Create a name Env_name Virtual environment for (Env_name You can change it yourself )

Start the virtual environment

 # Switch the path to the created virtual environment folder 
cd Scripts # Switch path entry Scripts In the folder 
activate.bat # Activate the virtual environment 

Import virtual environment

open pycharm -> settting -> project -> Python Interpreter

Click on Add Python Interpreter --> Virtualenv Environmeent, Choose an existing environment

Shut down the virtual environment

 # When the virtual environment starts, shut down the virtual environment with the following instructions 
deactivate

  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved