mesonbuild / meson-python

Meson PEP 517 Python build backend
https://mesonbuild.com/meson-python/
MIT License
118 stars 59 forks source link

Error installing meson-python with brew (MacOSX 10.15.7) #597

Closed rogeriod closed 3 months ago

rogeriod commented 3 months ago

I have Python 3.12.2 and Meson 1.3.2 installed. When I attempt to install meson-python with brew, I get this error message ... any ideas as to how to resolve this? I'm on a Mac Intel running MacOSX 10.15.7 (Catalina). Thanks!

rogerio@Rogerios-iMac ~ % brew install meson-python
Warning: You are using macOS 10.15.
We (and Apple) do not provide support for this old version.
It is expected behaviour that some formulae will fail to build in this old version.
It is expected behaviour that Homebrew will be buggy and slow.
Do not create any issues about this on Homebrew's GitHub repositories.
Do not create any issues even if you think this message is unrelated.
Any opened issues will be immediately closed without response.
Do not ask for help from Homebrew or its maintainers on social media.
You may ask for help in Homebrew's discussions but are unlikely to receive a response.
Try to figure out the problem yourself and submit a fix as a pull request.
We will review it but may or may not accept it.

==> Fetching meson-python
==> Downloading https://raw.githubusercontent.com/Homebrew/homebrew-core/ce9ebd98f5b322d1f6fb4b37721b4f34e76eb23f/Formu
Already downloaded: /Users/rogerio/Library/Caches/Homebrew/downloads/82b31ce996f3a487bd5f61fa6820274de2db4db6432a2ac35218876e99ddd8c2--meson-python.rb
==> Downloading https://files.pythonhosted.org/packages/38/af/b0e6a9eba989870fd26e10889446d1bec2e6d5be0a1bae2dc4dcda9ce
Already downloaded: /Users/rogerio/Library/Caches/Homebrew/downloads/02a5747f866df5e01b26c1ac33117077b407fa30a2163ad46620e3f3a26f7833--pyproject-metadata-0.7.1.tar.gz
==> Downloading https://files.pythonhosted.org/packages/c0/3f/d7af728f075fb08564c5949a9c95e44352e23dee646869fa104a3b206
Already downloaded: /Users/rogerio/Library/Caches/Homebrew/downloads/c18681289175fb45367956fde79823bf2d98bab623266b25e1d8f5b8b5845bfe--tomli-2.0.1.tar.gz
==> Downloading https://files.pythonhosted.org/packages/a2/3b/276b596824a0820987fdcc7721618453b4f9a8305fe20b611a00ac3f9
Already downloaded: /Users/rogerio/Library/Caches/Homebrew/downloads/1709bf19f58d282ce75b45d2bc4b0bf5f64d22c6387f1d2e5ba4686a063085c4--meson_python-0.15.0.tar.gz
Error: An exception occurred within a child process:
  TypeError: Parameter 'python': Expected type T.any(Pathname, String), got type Formulary::FormulaNamespaceAPIe850a65aec9bf3c6062278a00519b2d0dbe0aacf00851741dc120e93d0b3a4be::PythonAT311 with value #<Formula python@3.11 (stab...core/Formula/p/python@3.11.rb>
Caller: /Users/rogerio/Library/Caches/Homebrew/api-source/Homebrew/homebrew-core/ce9ebd98f5b322d1f6fb4b37721b4f34e76eb23f/Formula/meson-python.rb:42
Definition: /usr/local/Homebrew/Library/Homebrew/language/python.rb:23
rogerio@Rogerios-iMac ~ % 
dnicolodi commented 3 months ago

It looks like an Homebrew issue. meson-python works just fine with Homebrew.

You can install meson-python for the Homebrew Python installation with pip: python -m pip install meson-python.

rogeriod commented 3 months ago

When installed from the cmd line as you've suggested, it's still not visible to brew ...

rogerio@Rogerios-iMac ~ % brew info numpy 
==> numpy: stable 1.26.4, HEAD
Package for scientific computing with Python
https://www.numpy.org/
Not installed
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/n/numpy.rb
License: BSD-3-Clause
==> Dependencies
Build: python-setuptools ✔, gcc ✔, libcython ✔, meson ✔, meson-python ✘, ninja ✔, python@3.11 ✔, python@3.12 ✔
Required: openblas ✔
==> Options
--HEAD
    Install HEAD version
==> Caveats
To run `f2py`, you may need to `brew install python@3.12`
==> Analytics
install: 73,692 (30 days), 173,127 (90 days), 389,282 (365 days)
install-on-request: 12,971 (30 days), 37,509 (90 days), 150,359 (365 days)
build-error: 27 (30 days)
rogerio@Rogerios-iMac ~ %                
dnicolodi commented 3 months ago

Yes, if you install a Python package via pip, the Homebrew package manager will not know about it. If you need the Homebrew package installed as a dependency for compiling some other package, you need to fix the meson-python Homebrew package. However, you are running an unsupported version of Homebrew...

eli-schwartz commented 3 months ago
  TypeError: Parameter 'python': Expected type T.any(Pathname, String), got type Formulary::FormulaNamespaceAPIe850a65aec9bf3c6062278a00519b2d0dbe0aacf00851741dc120e93d0b3a4be::PythonAT311 with value #<Formula python@3.11 (stab...core/Formula/p/python@3.11.rb>
Caller: /Users/rogerio/Library/Caches/Homebrew/api-source/Homebrew/homebrew-core/ce9ebd98f5b322d1f6fb4b37721b4f34e76eb23f/Formula/meson-python.rb:42
Definition: /usr/local/Homebrew/Library/Homebrew/language/python.rb:23

This is: https://github.com/Homebrew/homebrew-core/blob/ce9ebd98f5b322d1f6fb4b37721b4f34e76eb23f/Formula/m/meson-python.rb#L42

And by extension also https://github.com/Homebrew/brew/blob/cd1f0409493c77e7964cf03a0fb1e93d03a83772/Library/Homebrew/language/python.rb#L22-L23

You'll have to ask the homebrew developers what the error message means since it's a homebrew error message, not a meson-python error message.

rogeriod commented 3 months ago

Thank you both @dnicolodi and @eli-schwartz. I'll look into issue on the homebrew side. Thanks again!