engineering24 Aug 2026

how to re-use pipenv environment

how to re-use pipenv environment

credit: unsplash.com

some of us may have had the occasional urge to test out some code using an already existing virtual environment dependencies. the rule of the thumb is that we should always keep python projects concerns/dependencies separate from each other for well known reasons.

however, i have come across a situation where I just needed to try out some code without necessarily creating an entirely new virtual environment using pipenv. well it's easy as creating a .venv file in your new project and including in it the location of the virtual environment. this is the folder that holds the pipenv files and folders. it normally includes some hashed code at the end of the folder name. so your .venv file would have in it a line as shown below:

C:\Users\User Name\.virtualenvs\Pipenvfolder-TVgiFkue

Note: there are no quotes in the path.

thanks for readingback to blogs