Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 282
darkavenger Avatar asked Jan 15 '19 11:01

darkavenger


People also ask

What does pip install Pipenv do?

Pipenv is a tool that provides all necessary means to create a virtual environment for your Python project. It automatically manages project packages through the Pipfile file as you install or uninstall packages.

Does Pipenv use pip?

Pipenv uses pip and virtualenv under the hood but simplifies their usage with a single command line interface.

What is the difference between pip install and Python pip install?

They do exactly the same thing. In fact, the docs for distributing Python modules were just updated to suggest using python -m pip instead of the pip executable, because it's easier to tell which version of python is going to be used to actually run pip that way.

What does it mean to install with pip?

Package Installer for Python (pip) is the de facto and recommended package-management system written in Python and is used to install and manage software packages. It connects to an online repository of public packages, called the Python Package Index.


1 Answers

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.

like image 140
Sewagodimo Matlapeng Avatar answered Sep 18 '22 10:09

Sewagodimo Matlapeng