Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between installing a package using pip vs. apt-get?

I'm trying to deploy a Django site on an Ubuntu machine. I need to install Psycopg2 and PIL but it seems that I'm able to install them using either apt-get or using pip. Is there a difference in installing by the two methods? I know that using pip, I'm able to install it into a virtual environment but with apt-get it installs in the global python environment.

like image 757
Mridang Agarwalla Avatar asked Jul 29 '11 14:07

Mridang Agarwalla


People also ask

Is pip the same as apt-get?

pip is used to download and install packages directly from PyPI. PyPI is hosted by Python Software Foundation. It is a specialized package manager that only deals with python packages. apt-get is used to download and install packages from Ubuntu repositories which are hosted by Canonical.

What is difference between pip install and 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 is the difference between installing a package with conda and pip?

This highlights a key difference between conda and pip. Pip installs Python packages whereas conda installs packages which may contain software written in any language. For example, before using pip, a Python interpreter must be installed via a system package manager or by downloading and running an installer.

Where does apt-get install Python packages?

Usually python packages install to /usr/lib/python/ (ie: /usr/lib/python2.


1 Answers

You probably already know the benefits of apt-get. Automatic update notifications, other apt-installed packages that need those tools know they're installed, etc.

With pip, you know you're getting the latest version at the time you install it, you can install to a non-default version of Python, and you can install to a virtualenv.

If you don't need any of the features pip gives you, and you don't routinely have to install other Python packages which aren't available over APT, use the APT versions.

like image 122
agf Avatar answered Sep 18 '22 15:09

agf