Shrikant Dhayje
shriekdj

shriekdj

How to work with Python's normal venv and pipenv simultaneously

How to work with Python's normal venv and pipenv simultaneously

Using pipenv and venv simultanously

Shrikant Dhayje's photo
Shrikant Dhayje
·Aug 29, 2022·

2 min read

Subscribe to my newsletter and never miss my upcoming articles

Play this article

Table of contents

Why Need to solve this issue.

So I Just Want to Use pipenv but do not want my venv folder to built in my automatically decided location and also want to use pipenv automatically building the requirements list.

So For Resolving this issue I build a method of how to do that.

Straight to the Point The Steps are given below.

Create Virtual Environment normally with venv module

For Windows

py -3 -m venv venv_folder

For Linux or Mac Operating System

python -m venv venv_folder

or

python3 -m venv venv_folder

Activate the manually created virtual environment folder

For Windows

# for windows powershell
./venv_folder/Scripts/Activate.ps1

# for windows cmd
./venv_folder/Scripts/activate.bat

# for windows with posix shell like git bash cli
source venv_folder/Scripts/activate

For Linux Based operating system or MacOS

source venv_folder/bin/activate

if you have any issues activating the venv please refer below post

Install pipenv twice

Install the pipenv like given below

pip install pipenv

pipenv install pipenv
Courtesy Notice: Pipenv found itself running within a virtual environment, so it will automatically use that environment, instead of creating its own for any project. You can set PIPENV_IGNORE_VIRTUALENVS=1 to force pipenv to ignore that environment and create its own instead. You can set PIPENV_VERBOSITY=-1 to suppress this warning.
Installing pipenv...
...

Now install packages with pipenv as normal

You will now have pipenv and venv_folder both at the same time to run it.

 
Share this