"brew install"和"brew install"之间有区别吗?和"pip install"? [英] Is there a difference between "brew install" and "pip install"?
问题描述
我想在Mac上安装枕头.我有python 2.7
和python 3.4
,都与Homebrew一起安装.我尝试了brew install pillow
,但效果很好,但仅适用于python 2.7
.我还没有找到为python 3
安装它的方法.我尝试了brew install pillow3
,但是没有运气.我在SO上找到了一条帖子,上面说要先用Homebrew安装pip3
,然后再使用pip3 install pillow
.碰巧,我已经安装了pip3
.
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
.
我从不了解使用pip
安装python软件包和使用Homebrew安装之间的区别(如果有的话).你能跟我解释一下吗?另外,如果有公式,是否最好与Homebrew一起安装?如果确实最好使用Homebrew进行安装,那么您知道如何使用Homebrew为python 3
安装pillow
吗?
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?
第一个答案表明我并没有说清楚自己.如果我用pip install pillow
而不是brew install pillow
安装了枕头,那么系统上的安装会有所不同吗?为什么Homebrew会制定一个公式来执行pip
已经执行的操作?是否会检查其他先决条件或其他内容?为什么用python2
的枕头有一个公式,但据我所知python3
的pillow
却不尽人意?
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
?
推荐答案
好,OSX的软件包可能包括python的软件包.
well, packages for OSX may include packages for python.
pip
是python世界的打包程序-您应该只能使用它安装python-things. homebrew
是针对OSX的软件包管理器;它对您可以安装的软件没有任何限制-因为 python 是 software 的子集.
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.
使用brew
安装东西会将它们安装到/usr/local/
;
installing things with brew
will install them into /usr/local/
;
使用pip
安装东西会从 Python包索引中获取包,并将其安装在python解释器将在其中找到它们的位置:在您的主目录中(例如~/.local/lib/python2.7/site-packages/
)或在python解释器的某些全局搜索路径中(例如/usr/local/lib/python2.7/dist-packages/
)
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/
)
如果您已通过brew
安装了python
解释器,则很有可能可以直接使用通过brew
安装的所有python软件包.
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.
这篇关于"brew install"和"brew install"之间有区别吗?和"pip install"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!