Linux command
pyenv-virtualenv 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Create virtualenv
pyenv virtualenv [3.11.0] [myproject]
List virtualenvs
pyenv virtualenvs
Activate virtualenv
pyenv activate [myproject]
Deactivate virtualenv
pyenv deactivate
Delete virtualenv
pyenv virtualenv-delete [myproject]
Set local virtualenv
pyenv local [myproject]
Create with current version
pyenv virtualenv [myproject]
说明
pyenv-virtualenv is a pyenv plugin that manages Python virtual environments alongside pyenv's version management. It creates isolated environments tied to specific Python versions, each with its own independent set of installed packages, and integrates them seamlessly into pyenv's version-switching workflow. Virtual environments created with this plugin appear as regular pyenv versions and can be activated using pyenv activate or auto-activated by setting a local version with pyenv local. When a .python-version file references a virtualenv name, entering that directory automatically activates the environment and leaving it deactivates, providing a frictionless per-project workflow.
参数
- virtualenv _VERSION_ _NAME_
- Create new virtualenv.
- virtualenvs
- List virtualenvs.
- activate _NAME_
- Activate virtualenv.
- deactivate
- Deactivate current.
- virtualenv-delete _NAME_
- Delete virtualenv.
FAQ
What is the pyenv-virtualenv command used for?
pyenv-virtualenv is a pyenv plugin that manages Python virtual environments alongside pyenv's version management. It creates isolated environments tied to specific Python versions, each with its own independent set of installed packages, and integrates them seamlessly into pyenv's version-switching workflow. Virtual environments created with this plugin appear as regular pyenv versions and can be activated using pyenv activate or auto-activated by setting a local version with pyenv local. When a .python-version file references a virtualenv name, entering that directory automatically activates the environment and leaving it deactivates, providing a frictionless per-project workflow.
How do I run a basic pyenv-virtualenv example?
Run `pyenv virtualenv [3.11.0] [myproject]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does virtualenv _VERSION_ _NAME_ do in pyenv-virtualenv?
Create new virtualenv.