venvlink
is very different tool than pipenv
. (See also: python-virtual-environments).
venvlink
is a virtual environment management tool, where the main purpose is just to create links toactivate
scripts of virtual environments inside project folders.pipenv
is a dependency manager tool which replacespip
, and creates virtual environment automatically, mapping projects to their virtual environments. It is highly optimized for a 1:1 workflow (1 venv per project).
pipenv
creates virtual environments automatically when runningpipenv install
in the project folder. The virtual environment name will be project's root directory plus a hash from the full path of the project's root, e.g.myproject-a83de32
.- Creating virtual environments with
venvlink
is the same as creating virtual environments withpython -m venv <project_name>
. It is also possible to just create a link to existing virtual environment withvenvlink
.
- Because
pipenv
follows 1:1 mapping between projects and virtual environments, you will always have as many virtual environments as projects started withpipenv
. There is no way to reuse virtual environments. - With
venvlink
, it is possible to create as many links as you wish to same virtual environment; you can have only 6 virtual environments that serve 20 projects.
- With
pipenv
it is possible to run python scripts without activating virtual environment withpipenv run ...
, when command is ran in the project folder. - Another way activating venvs in
pipenv
is runningpipenv shell
inside project folder or one of it's subfolders. - Using virtual environments outside the project folder would looks something like this in
pipenv
: Let's say you have two dependent.py
files in same folder and you want to run them in a virtual environment ofmyproj
, the process would becd
into the project folder (myproj
)pipenv shell
to activate the virtual environmentcd
into the folder with the two.py
files.- Run the script(s)
- With
venvlink
, one would activate the virtual environment using theactivate
script ("link") located in the project folder. The cwd can be anything when theactivate
script is ran. - With
venvlink
it is also possible to run the python executable directly with<venv_folder>/<venv_name>/Scipts/python.exe ...
, if needed (as with when usingvenv
withoutvenvlink
) - It is also possible to use
pew
with venvlink. (and activate virtual environments usingpew workon myproject
) venvlink
(0.5.0+) has support for automatically activating and deactivating virtual environments in Powershell using venvlink-autoenv.
- With
pipenv
, there exists 1:1 mapping between virtual environments and projects; The project also can only use it's own virtual environment. Changing virtual environment is possible only by removing and recreating the virtual environment altogether. - With
venvlink
it is possible to point a project to new virtual environment just bypython -m venvlink new_venv_name
. It is possible to change a virtual environment really fast, and it can include changing the python version. venvlink
can also create links pointing to centralized virtual environments created with any other tool, such aspew
.
Sometimes projects need to be relocated or the project path needs to be renamed slightly.
- If project folder is renamed or relocated*,
pipenv
cannot find the virtual environment anymore. (see this and this) - If project folder is renamed or relocated withing the same computer, the
activate
scripts created withvenvlink
will continue working, since they are just one-way links to the real activate scripts.
* When using the the centralized folder for virtual environments with pipenv.