Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a difference between "brew install" and "pip install"?

I want to install pillow on my Mac. I have python 2.7 and python 3.4, both installed with Homebrew. I tried brew install pillow and it worked fine, but only for python 2.7. I haven't been able to find a way to install it for python 3. I tried brew install pillow3 but no luck. I've found a post on SO that says to first install pip3 with Homebrew and then use pip3 install pillow. As it happens, I have already installed pip3.

I've never understood the difference, if any, between installing a python package with pip and installing it with Homebrew. Can you explain it to me? Also, is it preferable to install with Homebrew if a formula is available? If installing with Homebrew is indeed preferable, do you know how to install pillow for python 3 with Homebrew?

The first answers indicate that I haven't made myself plain. If I had installed pillow with pip install pillow instead of brew install pillow would the installation on my system be any different? Why would Homebrew make a formula that does something that pip already does? Would it check for additional prerequisites or something? Why is there a formula for pillow with python2, but not as far as I can tell for pillow with python3?

like image 827
saulspatz Avatar asked Sep 11 '15 19:09

saulspatz


People also ask

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 pip install?

pip is the package installer for Python. It is used to install, update, and uninstall various Python packages (libraries).

What can I use instead of pip install?

npm, Homebrew, Yarn, RequireJS, and Bower are the most popular alternatives and competitors to pip.

What is the difference between pip install and apt get install?

apt-get is pre-compiled, which installs much faster than pip . To install numpy, matplotlib, pandas, and other scipy-related modules, apt-get only takes seconds; pip can easily consume 10min+. If you have root access and don't mind a little outdated versions, apt-get is the fast & worry-free way to go.

Why is Pip not in my path after installing via brew?

Note: If pip is still not in your path after installing via brew, the solution is to re-link. Run brew unlink python && brew link python.

What is Brew and Pip for testers?

Here’s an introduction to Brew and Pip for testers. Python is the most popular testing automation script language nowadays. If you want to work with Python, you need a command-line package installer to install and manage additional libraries and dependencies that are not distributed as part of the standard libraries.

Should I install Pip with Python 2 or 3?

The problem with installing pip with Python 2 and pip3 with Python 3 is people tend to rely on the default, non-suffixed version. With this change, Homebrew lets you choose which you want to have as a default python / pip using e.g. aliases or modifying your PATH. Show activity on this post.

Can I use PIP on other operating systems?

It's written in Python, and you can use it on all kinds of operating systems but for installing Python packages only. There’s good news about installation: Pip is already installed if you are using Python 2 >=2.7.9 or Python 3 >=3.4 downloaded frompython.org. If you are using previous versions, check the detailed installation guide here.


2 Answers

well, packages for OSX may include packages for python.

pip is a packager for the python world - you should only ever be able to install python-things with it; homebrew is a package manager targetted at OSX; it doesn't impose any restrictions onto what software you can install with it - since python is a subset of software.

installing things with brew will install them into /usr/local/;

installing things with pip will fetch packages from the Python Package Index, and it will install them in a place where your python interpreter will find them: either into your home directory (e.g. ~/.local/lib/python2.7/site-packages/) or in some global search-path of your python interpreter (e.g. /usr/local/lib/python2.7/dist-packages/)

if you have installed the python interpreter via brew, then chances are high that any python-package installed via brew will be usable out of the box.

like image 66
umläute Avatar answered Sep 24 '22 04:09

umläute


Homebrew is a package manager, similar to apt on ubuntu or yum on some other linux distros. Pip is also a package manager, but is specific to python packages. Homebrew can be used to install a variety of things such as databases like MySQL and mongodb or webservers like apache or nginx.

like image 30
wpercy Avatar answered Sep 24 '22 04:09

wpercy