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

后端 未结 3 2026
野趣味
野趣味 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条回答
  •  感情败类
    2020-12-12 19:34

    I am also kind of confused about the differences between pip-installed vs. brew-installed python packages.

    My understanding is that pip-installed package is not compiled for your specific system. It fetches the package from the the Python Package Index then compile and build it in your computer. Python package installed via homebrew is already built and compiled for your specific system (Macos). They should both work. But I am not sure whether packages installed from the two ways will be put in the same location.

    For your questions about installing pillow via homebrew, I believe you should already done brew tap homebrew/python, because that's how you can install python packages from homebrew. On this github page they claim that

    Formula are installed with Python 2 support by default. For simultaneous Python 3 support, use brew install --with-python3. If you don't need Python 2.x support at all, you can pass --with-python3 --without-python.

    So try

    brew install pillow --with-python3

    or

    brew install pillow --with-python3 --without-python

    if you only want to install pillow for python3. You may need to do brew uninstall pillow first if homebrew warns you that pillow is already installed.

提交回复
热议问题