简体   繁体   English

“pyenv virtualenvwrapper”有什么作用?

[英]What does "pyenv virtualenvwrapper" do?

I am using pyenv with virtualenvwrapper.我正在使用带有 virtualenvwrapper 的 pyenv。

For using virtualenvwrapper (without pyenv) I have in my .bash_profile source /usr/local/bin/virtualenvwrapper.sh对于使用 virtualenvwrapper(没有 pyenv),我在我的 .bash_profile源 /usr/local/bin/virtualenvwrapper.sh

When using pyenv with virtualenvwrapper plugin what exactly does pyenv virtualenvwrapper do ?当使用带有 virtualenvwrapper 插件的 pyenv 时, pyenv virtualenvwrapper到底做了什么?

What I see online is this is required to setup a virtualenvwrapper into your shell .我在网上看到的是在你的 shell 中设置一个 virtualenvwrapper是必需的。 Is it still required if I have sourced virtualenvwrapper.sh ?如果我已经采购了 virtualenvwrapper.sh ,还需要它吗?

To add some more details: as per https://alysivji.github.io/setting-up-pyenv-virtualenvwrapper.html添加更多细节:根据https://alysivji.github.io/setting-up-pyenv-virtualenvwrapper.html

Anytime we install a new version of Python, we will need to install 
virtualenvwrapper. This is done with either the pyenv 
virtualenvwrapper or pyenv virtualenvwrapper_lazy

Is it required only once when a new version of python is installed in pyenv ?在 pyenv 中安装新版本的 python 时是否只需要一次?

In short, from the pyenv-virtualenvwrapper readme :简而言之,来自 pyenv-virtualenvwrapper自述文件:

pyenv-virtualenvwrapper is a pyenv plugin which provides a pyenv virtualenvwrapper command to manage your virtualenvs with virtualenvwrapper. pyenv-virtualenvwrapper 是一个 pyenv 插件,它提供了一个 pyenv virtualenvwrapper 命令来使用 virtualenvwrapper 管理你的 virtualenvs。

There are three tools involved here:这里涉及三个工具:

  1. virtualenv or venv - Used for isolating python environments (collections of packages) by using 'virtual environments'. virtualenvvenv - 用于通过使用“虚拟环境”来隔离 python 环境(包的集合)。 virtualenv has been more or less superseded by venv , but for the purpose of this answer, they are interchangeable. virtualenv或多或少已被venv取代,但出于此答案的目的,它们是可以互换的。
  2. virtualenvwrapper - A set of tools for automating some of the steps involved in using virtualenv or venv . virtualenvwrapper - 一组工具,用于自动化使用virtualenvvenv所涉及的一些步骤。
  3. pyenv-virtualenvwrapper is a plugin that allows virtualenvwrapper to work with pyenv pyenv-virtualenvwrapper是一个允许virtualenvwrapperpyenv一起工作的插件
  4. pyenv - a tool for managing multiple versions of python on the same computer system. pyenv - 用于在同一计算机系统上管理多个 python 版本的工具。

Another way to manage virtual environments when using pyenv is pyenv-virtualenv使用pyenv时管理虚拟环境的另一种方法是pyenv-virtualenv

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM