Question

What is the difference between pipenv install <package> compared to pip install <package>?

What is the difference between using pipenv install <package> compared to using pip install <package> after activating an environment using pipenv shell.

I know pipenv install <package> will

  1. Create the virtual environment if it is not created yet.
  2. Runs pipenv lock command automatically.

Apart from these, is there any other difference between these two?

 46  16807  46
1 Jan 1970

Solution

 30

If you are installing using a pipenv environment you should always install your packages using pipenv, this way it will update your pipfile.lock file. Also be careful because pip install <package> will pretty much work anywhere, it's not installing packages to your virtual environment, it's installing them into your computer. Pipenv will update your Pipfile.lock and actually install into your pipenv virtual enviroment if you have one open.

It's rarely a good idea to pip install <package> outside of a virtualenv.

2019-01-24