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

Configuring Python virtual environment in vscode under windows10

編輯:Python

windows10 Next in VScode Internal configuration python A virtual environment
One 、 edition
1、windows10
2、VScode1.53.2
3、python3.9.6

Two 、 It suddenly occurred to me that the original intention of configuring this environment is to pytest Automated testing , I hope to take time to study every week , And produce one or more learning articles

3、 ... and 、 To configure
1、 install python

2、 install Code Runner plug-in unit

3、 stay terminal Type in python -m venv fish_venv( The file name you want to create )
( Apple computer input python3 -m venv fish_venv( The file name you want to create ))
Generate the file on the side

4、 Apple computer directly type source ./fish_venv( Your file name )/bin/activate Enable virtual environment
windows turn 5
5、windows System typing source ./fish_venv( Your file name )/bin/activate Will report a mistake

as a result of Windows In the system , It's through .\venv( Your file name )\Scripts\activate Command to enter the virtual environment , Because it's running activate.bat It will be generated in the same level directory activate.ps1,PowerShell Execution is not allowed by default *.ps1 Script files . You need to set Power Shell: Run as administrator Power Shell
type set-executionpolicy remotesigned command , And select Y
6、 Activate after execution vscode Medium terminal, It will be activated by default venv A virtual environment

7、 If you want to exit the virtual environment , stay terminal Type in deactivate


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