Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why brew needs python while installing php7

While installing php via brew on MacOs, i got the output below. So i am asking why python dependency is needed while installing php?

==> Installing dependencies for [email protected]: [email protected] and glib
==> Installing [email protected] dependency: [email protected]
==> Pouring [email protected]_4.mojave.bottle.tar.gz
==> /usr/local/Cellar/[email protected]/3.9.1_4/bin/python3 -m ensurepip
==> /usr/local/Cellar/[email protected]/3.9.1_4/bin/pip3 install -v --global-option=--no-user-cfg --install-option=--force --install-option=--single-version-externally-managed --install-option=--record=installed.txt --upgrade --target=/usr/local
==> Caveats
Python has been installed as
  /usr/local/bin/python3

Unversioned symlinks `python`, `python-config`, `pip` etc. pointing to
`python3`, `python3-config`, `pip3` etc., respectively, have been installed into
  /usr/local/opt/[email protected]/libexec/bin

You can install Python packages with
  pip3 install <package>
They will install into the site-package directory
  /usr/local/lib/python3.9/site-packages

See: https://docs.brew.sh/Homebrew-and-Python
==> Summary
šŸŗ  /usr/local/Cellar/[email protected]/3.9.1_4: 3,932 files, 61.7MB
==> Installing [email protected] dependency: glib
==> Pouring glib-2.66.4_1.mojave.bottle.1.tar.gz
==> Caveats
Bash completion has been installed to:
  /usr/local/etc/bash_completion.d
==> Summary
šŸŗ  /usr/local/Cellar/glib/2.66.4_1: 441 files, 20.3MB
==> Installing [email protected]
like image 305
Erce Avatar asked Aug 15 '26 04:08

Erce


1 Answers

I know this question has some age but I just want to answer it.


In Homebrew, [email protected] depends on [email protected], it is because:

  1. [email protected] does NOT depend on [email protected]. See the output of brew deps --tree [email protected] below
  2. Homebrew requires Python (and it will update the version from time to time) in some cases (read this), as it does not use the system Python version.

Conclusion: it's Homebrew that needs Python, not PHP 7.4.

Output of brew deps --tree [email protected]:

[email protected]
ā”œā”€ā”€ apr
ā”œā”€ā”€ apr-util
│   ā”œā”€ā”€ apr
│   └── openssl@3
│       └── ca-certificates
ā”œā”€ā”€ argon2
ā”œā”€ā”€ aspell
ā”œā”€ā”€ autoconf
│   └── m4
ā”œā”€ā”€ curl
│   ā”œā”€ā”€ brotli
│   ā”œā”€ā”€ libidn2
│   │   ā”œā”€ā”€ libunistring
│   │   └── gettext
│   ā”œā”€ā”€ libnghttp2
│   ā”œā”€ā”€ libssh2
│   │   └── openssl@3
│   │       └── ca-certificates
│   ā”œā”€ā”€ openldap
│   │   └── openssl@3
│   │       └── ca-certificates
│   ā”œā”€ā”€ openssl@3
│   │   └── ca-certificates
│   ā”œā”€ā”€ rtmpdump
│   │   └── openssl@3
│   │       └── ca-certificates
│   └── zstd
│       ā”œā”€ā”€ lz4
│       └── xz
ā”œā”€ā”€ freetds
│   ā”œā”€ā”€ openssl@3
│   │   └── ca-certificates
│   └── unixodbc
│       └── libtool
│           └── m4
ā”œā”€ā”€ gd
│   ā”œā”€ā”€ fontconfig
│   │   └── freetype
│   │       └── libpng
│   ā”œā”€ā”€ freetype
│   │   └── libpng
│   ā”œā”€ā”€ jpeg-turbo
│   ā”œā”€ā”€ libavif
│   │   ā”œā”€ā”€ aom
│   │   │   ā”œā”€ā”€ jpeg-xl
│   │   │   │   ā”œā”€ā”€ brotli
│   │   │   │   ā”œā”€ā”€ giflib
│   │   │   │   ā”œā”€ā”€ highway
│   │   │   │   ā”œā”€ā”€ imath
│   │   │   │   ā”œā”€ā”€ jpeg-turbo
│   │   │   │   ā”œā”€ā”€ libpng
│   │   │   │   ā”œā”€ā”€ little-cms2
│   │   │   │   │   ā”œā”€ā”€ jpeg-turbo
│   │   │   │   │   └── libtiff
│   │   │   │   │       ā”œā”€ā”€ jpeg-turbo
│   │   │   │   │       ā”œā”€ā”€ xz
│   │   │   │   │       └── zstd
│   │   │   │   │           ā”œā”€ā”€ lz4
│   │   │   │   │           └── xz
│   │   │   │   ā”œā”€ā”€ openexr
│   │   │   │   │   └── imath
│   │   │   │   └── webp
│   │   │   │       ā”œā”€ā”€ giflib
│   │   │   │       ā”œā”€ā”€ jpeg-turbo
│   │   │   │       ā”œā”€ā”€ libpng
│   │   │   │       └── libtiff
│   │   │   │           ā”œā”€ā”€ jpeg-turbo
│   │   │   │           ā”œā”€ā”€ xz
│   │   │   │           └── zstd
│   │   │   │               ā”œā”€ā”€ lz4
│   │   │   │               └── xz
│   │   │   └── libvmaf
│   │   ā”œā”€ā”€ jpeg-turbo
│   │   └── libpng
│   ā”œā”€ā”€ libpng
│   ā”œā”€ā”€ libtiff
│   │   ā”œā”€ā”€ jpeg-turbo
│   │   ā”œā”€ā”€ xz
│   │   └── zstd
│   │       ā”œā”€ā”€ lz4
│   │       └── xz
│   └── webp
│       ā”œā”€ā”€ giflib
│       ā”œā”€ā”€ jpeg-turbo
│       ā”œā”€ā”€ libpng
│       └── libtiff
│           ā”œā”€ā”€ jpeg-turbo
│           ā”œā”€ā”€ xz
│           └── zstd
│               ā”œā”€ā”€ lz4
│               └── xz
ā”œā”€ā”€ gettext
ā”œā”€ā”€ gmp
ā”œā”€ā”€ icu4c
ā”œā”€ā”€ krb5
│   └── openssl@3
│       └── ca-certificates
ā”œā”€ā”€ libpq
│   ā”œā”€ā”€ krb5
│   │   └── openssl@3
│   │       └── ca-certificates
│   └── openssl@3
│       └── ca-certificates
ā”œā”€ā”€ libsodium
ā”œā”€ā”€ libzip
│   └── zstd
│       ā”œā”€ā”€ lz4
│       └── xz
ā”œā”€ā”€ oniguruma
ā”œā”€ā”€ openldap
│   └── openssl@3
│       └── ca-certificates
ā”œā”€ā”€ [email protected]
│   └── ca-certificates
ā”œā”€ā”€ pcre2
ā”œā”€ā”€ sqlite
│   └── readline
ā”œā”€ā”€ tidy-html5
└── unixodbc
    └── libtool
        └── m4

Or if you prefer a graphical version that shows in a browser, you can use this command:

brew deps --graph [email protected]

Last, if you only prefer a summary of all dependencies, you can use this command:

brew deps [email protected]
like image 120
Raptor Avatar answered Aug 17 '26 17:08

Raptor



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!