Is there a difference between “brew install” and “pip install”?

后端 未结 3 2038
野趣味
野趣味 2020-12-12 19:07

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

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-12 19:20

    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.

提交回复
热议问题