What's the relationship between environments and projects in virtualenvwrapper?

后端 未结 2 1083
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-13 00:07

In other words, what\'s the difference between the mkvirtualenv and mkproject commands?

I have a workflow that looks like this:



        
2条回答
  •  闹比i
    闹比i (楼主)
    2021-02-13 00:47

    mkvirtualenv is command from virtualenvwrapper that makes managing python virtualenvs easier, while mkproject comes from a virtualenvwrapper plugin to manage your projects (that was integrated directly into virtualenvwrapper)

    the plugin page mentions the following features:

    Manages your development project work directories along with your virtualenv environments. Defines an API for creating templates to quickly create new environments consistently. Use workon command from virtualenvwrapper to switch between projects. User-configurable hooks for customizing new projects.

    You don't have to create or manage your projects using the virtualenvwrapper plugin to use the virtualenv commands. It's just a convenience plugin for stuff like swapping to the project directory when issuing a workon command, or from creating new projects from templates.

    virtualenv for itself has no library sharing capability except with the systems site-packages if you use the correct flag. I stumbled once over a project that gave you this ability among other things, but never found it again.

    EDIT: virtualenvwrapper now has the functionality to copy virtualenvs, and to add directories to your virtualenv PATH in order to share libraries.

提交回复
热议问题