tconbeer / harlequin

The SQL IDE for Your Terminal.
https://harlequin.sh
MIT License
3.65k stars 83 forks source link

Documented way of harlequin installation using pipx doesn't work #515

Closed vlnn closed 5 months ago

vlnn commented 5 months ago

Before Proceeding, please acknowledge:

Describe the bug Documented way of harlequin installation using pipx doesn't work (for me, on MacOS Sonoma)

To Reproduce

~ ❯ pipx install harlequin

Expected behavior A clear and concise description of what you expected to happen.

Actual behavior

Fatal error from pip prevented installation. Full pip output in file:
    /Users/va/.local/pipx/logs/cmd_2024-04-13_12.13.38_pip_errors.log

pip seemed to fail to build package:
    tree-sitter<0.21.0,>=0.20.1

Some possibly relevant errors from pip install:
    ERROR: Ignored the following versions that require a different python version: 1.7.0 Requires-Python >=3.6,<3.10; 1.8.0 Requires-Python >=3.6,<3.10; 1.8.1 Requires-Python >=3.6,<3.10; 1.9.0 Requires-Python >=3.6,<3.10
    ERROR: Could not find a version that satisfies the requirement tree_sitter_languages>=1.7.0; extra == "syntax" (from textual[syntax]) (from versions: none)
    ERROR: No matching distribution found for tree_sitter_languages>=1.7.0; extra == "syntax"

Error installing harlequin.

Contributing Are you interested in contributing a fix?

Additional context

What other options are you using when invoking Harlequin? (If you are using a profile, please add relevant items from your profile here).

Can you tell us more about your system?

How did you install Harlequin?

vlnn commented 5 months ago

This may be related to me using python 3.10.7, but documentation clearly allows "Python 3.8 or above"

tconbeer commented 5 months ago

This is bizarre. Py3.10 is the most popular version for harlequin users. Pipx isn't finding tree-sitter-languages 1.10.

Can you try upgrading pipx and clearing the pipx cache?

vlnn commented 5 months ago

Can you try upgrading pipx and clearing the pipx cache?

Sure!

~ ❯ pipx --version # pipx installed with brew install pipx
1.5.0
~ ❯ brew list pipx
/opt/homebrew/Cellar/pipx/1.5.0/bin/pipx
/opt/homebrew/Cellar/pipx/1.5.0/etc/bash_completion.d/pipx
/opt/homebrew/Cellar/pipx/1.5.0/libexec/bin/ (8 files)
/opt/homebrew/Cellar/pipx/1.5.0/libexec/lib/ (131 files)
/opt/homebrew/Cellar/pipx/1.5.0/libexec/pyvenv.cfg
/opt/homebrew/Cellar/pipx/1.5.0/share/fish/vendor_completions.d/pipx.fish
/opt/homebrew/Cellar/pipx/1.5.0/share/zsh/site-functions/_pipx

Updating...

~ ❯ brew upgrade pipx
==> Downloading https://formulae.brew.sh/api/formula.jws.json
-#O#- #    #
==> Downloading https://formulae.brew.sh/api/cask.jws.json
-#O#- #    #
Warning: pipx 1.5.0 already installed

Cleaning pipx cache (the first way I've found over the internets — let me know if it's enough)

~ ❯ rm -rf .local/pipx
...

Retrying install harlequin:

~ ❯ pipx install harlequin
Fatal error from pip prevented installation. Full pip output in file:
    /Users/va/.local/pipx/logs/cmd_2024-04-13_19.50.58_pip_errors.log

pip seemed to fail to build package:
    tree-sitter<0.21.0,>=0.20.1

Some possibly relevant errors from pip install:
    ERROR: Ignored the following versions that require a different python version: 1.7.0 Requires-Python >=3.6,<3.10; 1.8.0 Requires-Python >=3.6,<3.10; 1.8.1 Requires-Python >=3.6,<3.10; 1.9.0 Requires-Python >=3.6,<3.10
    ERROR: Could not find a version that satisfies the requirement tree_sitter_languages>=1.7.0; extra == "syntax" (from textual[syntax]) (from versions: none)
    ERROR: No matching distribution found for tree_sitter_languages>=1.7.0; extra == "syntax"

Error installing harlequin.
vlnn commented 5 months ago

Could it be that tree_sitter used by textual changed dependencies somehow? Another option would be broken pipx setup on my computer, but I'm not aware how to test it. Log /Users/va/.local/pipx/logs/cmd_2024-04-13_19.50.58_pip_errors.log has pretty much same info:

...
Collecting tree-sitter<0.21.0,>=0.20.1 (from textual[syntax]<1.0.0,>=0.41.0->textual-textarea==0.9.5->harlequin)
  Using cached tree_sitter-0.20.4-cp310-cp310-macosx_10_9_universal2.whl.metadata (7.2 kB)
INFO: pip is looking at multiple versions of textual[syntax] to determine which version is compatible with other requirements. This could take a while.

PIP STDERR
----------
ERROR: Ignored the following versions that require a different python version: 1.7.0 Requires-Python >=3.6,<3.10; 1.8.0 Requires-Python >=3.6,<3.10; 1.8.1 Requires-Python >=3.6,<3.10; 1.9.0 Requires-Python >=3.6,<3.10
ERROR: Could not find a version that satisfies the requirement tree_sitter_languages>=1.7.0; extra == "syntax" (from textual[syntax]) (from versions: none)
ERROR: No matching distribution found for tree_sitter_languages>=1.7.0; extra == "syntax"
vlnn commented 5 months ago

Allright, I was able to install latest brew-available version of python (which is OK for my needs) which is 3.12.3 at the moment. This leads me to pipx reinstall-all after which I got to fully working environment:

~ ❯ pipx install harlequin
  installed package harlequin 1.16.2, installed using Python 3.12.3
  These apps are now globally available
    - harlequin
done! ✨ 🌟 ✨

I guess this issue is "kinda resolved" and document enough to someone struggling find it and reopen if needed.

tconbeer commented 5 months ago

Sorry you had to work through this. Thanks for sticking with it. I don't think there is anything I can do on my end to make this easier.