harelba / q

q - Run SQL directly on delimited files and multi-file sqlite databases
http://harelba.github.io/q/
GNU General Public License v3.0
10.15k stars 419 forks source link

q can't be installed by brew(OSX) #292

Closed ninjachen closed 2 years ago

ninjachen commented 2 years ago

Hello I can't install q in brew, because "pyoxidizer" can't be found. Any suggestion to let me install q on mac?

➜  consoles git:(master) brew install harelba/q/q
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (shivammathur/php).
==> Updated Formulae
Updated 9 formulae.

==> Installing q from harelba/q
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
Error: No available formula with the name "pyoxidizer" (dependency of harelba/q/q).
==> Searching for a previously deleted formula (in the last month)...
Error: No previously deleted formula found.
==> Searching taps on GitHub...
Error: No formulae found in taps.
harelba commented 2 years ago

Hi, thanks for notifying on this.

It's very odd actually, since I've checked and pyoxidizer is still in brew, both from the command line, and from their web page.

Would you mind running brew again with --verbose/--debug and send the output here? Perhaps we'll be able to understand the root cause for this.

btw - Which OSX version do you run on?

As a temporary workaround, you can download macos-q from the release page in github (https://github.com/harelba/q/releases/download/v3.1.6/macos-q) and use it directly.

Harel

harelba commented 2 years ago

@ninjachen can you please check if the problem still happens? If yes, it would really help me to get the brew output with verbose/debug so i can make sure it doesn't happen.

ilessing commented 2 years ago

I encountered this while using Homebrew to do a Python 3.10 install/upgrade

Warning: q has been deprecated because it requires PyOxidizer, which is a disallowed dependency in homebrew/core! ==> Downloading https://ghcr.io/v2/homebrew/core/q/manifests/2.0.20

Later as Homebrew was upgrading more dependencies console displayed:

==> Upgrading q
  2.0.19_3 -> 2.0.20 

==> Pouring q--2.0.20.catalina.bottle.tar.gz
🍺  /usr/local/Cellar/q/2.0.20: 590 files, 7.8MB
==> Running `brew cleanup q`...
Removing: /usr/local/Cellar/q/2.0.19_3... (592 files, 7.7MB)

When Homebrew completed I ran: brew info q and it replied:

q: stable 2.0.20 (bottled), HEAD
Run SQL directly on CSV or TSV files
https://harelba.github.io/q/
Deprecated because it requires PyOxidizer, which is a disallowed dependency in homebrew/core!
/usr/local/Cellar/q/2.0.20 (590 files, 7.8MB) *
  Poured from bottle on 2022-01-24 at 11:21:23
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/q.rb
License: GPL-3.0-or-later
==> Dependencies
Build: ronn ✘
Required: python@3.9 ✔, six ✔

and I'm able to use q to query CSV files as before.

My System: MacOS Catalina

system_profiler SPSoftwareDataType  -detailLevel mini
Software:
    System Software Overview:
      System Version: macOS 10.15.7 (19H1615)
      Kernel Version: Darwin 19.6.0

I recently upgraded from MacOS 10.14 Mojave.

I hope the above info is helpful.

harelba commented 2 years ago

ah, thanks! Now i see. It's not related to the new installation of q, it's related to the old one.

The error you're experiencing is a result of homebrew-core deprecating the old version of q too soon.

brew uninstall q before installing python 3.10 should I believe solve this (perhaps with the --force flag, since there seems to be some inconsistent state there in the behaviour of homebrew).

homebrew-core should not contain q anymore. I will try to see how it can be deleted from the original homebrew-core.

The new installation of q is in its own tap - brew install harelba/q/q.

Details: The deprecation warning about pyoxidizer is related to the reason i moved to the new tap - The maintainers there decided that pyoxidizer cannot be used to package code inside homebrew-core. I actually asked them to change the q deprecation message to something more usable for users, but they wouldn't agree to it, so I couldn't set it to something more descriptive.

ilessing commented 2 years ago

Awesome @harelba! Now I understand. Thanks for explanation.

ninjachen commented 2 years ago

Sorry for the late reply @harelba , I'm using macOS Big Sur v11.4, here is the debug info

➜  /tmp brew install harelba/q/q --debug
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/harelba/homebrew-q/Formula/q.rb
==> Installing q from harelba/q
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
Error: No available formula with the name "pyoxidizer" (dependency of harelba/q/q).
==> Searching for a previously deleted formula (in the last month)...
Error: No previously deleted formula found.
==> Searching taps on GitHub...
/usr/bin/curl --disable --globoff --show-error --user-agent Homebrew/3.1.9\ \(Macintosh\;\ Intel\ Mac\ OS\ X\ 11.4\)\ curl/7.64.1 --header Accept-Language:\ en --retry 3 --location https://api.github.com/search/code\?q=user\%3AHomebrew\+path\%3AFormula\+path\%3ACasks\+path\%3A.\+filename\%3Apyoxidizer\+extension\%3Arb\&per_page=100 --header Accept:\ application/vnd.github.v3\+json --write-out '
'\%\{http_code\} --header Accept:\ application/vnd.github.antiope-preview\+json --dump-header /private/tmp/github_api_headers20220126-59370-k3fttw
Error: No formulae found in taps.

If you need anything more, plz let me know.

I tried to install pyoxidizer manually, it failed with the same reason. I created an issue in their project #501

/tmp brew install pyoxidizer --debug
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
Error: No available formula or cask with the name "pyoxidizer".
==> Searching for a previously deleted formula (in the last month)...
Error: No previously deleted formula found.
==> Searching taps on GitHub...
/usr/bin/curl --disable --globoff --show-error --user-agent Homebrew/3.1.9\ \(Macintosh\;\ Intel\ Mac\ OS\ X\ 11.4\)\ curl/7.64.1 --header Accept-Language:\ en --retry 3 --location https://api.github.com/search/code\?q=user\%3AHomebrew\+path\%3AFormula\+path\%3ACasks\+path\%3A.\+filename\%3Apyoxidizer\+extension\%3Arb\&per_page=100 --header Accept:\ application/vnd.github.v3\+json --write-out '
'\%\{http_code\} --header Accept:\ application/vnd.github.antiope-preview\+json --dump-header /private/tmp/github_api_headers20220126-60939-192lp4r
Error: No formulae found in taps.
ninjachen commented 2 years ago

Since the issue is caused by pyoxidizer and I created https://github.com/indygreg/PyOxidizer/issues/501. I want to close this issue.