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

Python creating virtual environment

編輯:Python

python Creating a virtual environment

  • Installing a virtual environment
    • Creating a virtual environment
  • Be careful :virtualenv Can't use workon command

Installing a virtual environment

Use pip Command to download the library of the virtual environment pip install virtualenv
install virtualenvwrapper pip install virtualenvwrapper

Creating a virtual environment

mkvirtualenv env01 ( Environment name )
mkvirtualenv -p python3 py3env01 (python3 Under this condition, the environment name is py3env01 Subvirtual environment of )

The default path of the created file is Under the previously configured path exportWORKON_HOME=’~/.virtualenvs’ Subvirtual environment input path

Query the list of subvirtual environments

Be careful :virtualenv Can't use workon command

mkvirtualenv env_name
workon env_name # Enter a virtual environment
rmvirtualenv env_name ( It can be used in virtual environment , It can also not be used in the virtual environment )
deactivate
workon or lsvirtualenv View all currently existing virtual environments ,
lssitepackages( View the installed third-party command packages of all virtual environments , No need to enter the virtual environment )
cd virtualenv ( Jump to the directory where the virtual environment is located )
Out of the environment deactivate


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