aorwall / moatless-tools

MIT License
216 stars 20 forks source link

Install failed tree-sitter-python #6

Closed kwikiel closed 2 months ago

kwikiel commented 2 months ago

Got this issue - Installing tree-sitter-python (0.21.0): Failed

RuntimeError

Unable to find installation candidates for tree-sitter-python (0.21.0)

at /opt/homebrew/Cellar/poetry/1.8.2_2/libexec/lib/python3.12/site-packages/poetry/installation/chooser.py:74 in choose_for 70│ 71│ links.append(link) 72│ 73│ if not links: → 74│ raise RuntimeError(f"Unable to find installation candidates for {package}") 75│ 76│ # Get the best link 77│ chosen = max(links, key=lambda link: self._sort_key(package, link)) 78│

Cannot install tree-sitter-python.

Maybe it's because it doesn't have source distributions for my m1 Mac OS X 14.5 (23F79)

kwikiel commented 2 months ago

aah I will try to make it work on Mac OS

https://github.com/tree-sitter/tree-sitter-python/issues/262

this may work, but using pip

kwikiel commented 2 months ago

Temporary workaround:

using poetry shell created venv proceed with the following:

pip3 install git+https://github.com/tree-sitter/tree-sitter-python Collecting git+https://github.com/tree-sitter/tree-sitter-python Cloning https://github.com/tree-sitter/tree-sitter-python to /private/var/folders/hm/zmy00t1153s7n35mm5q8sg500000gn/T/pip-req-build-mtev6upc Running command git clone --filter=blob:none --quiet https://github.com/tree-sitter/tree-sitter-python /private/var/folders/hm/zmy00t1153s7n35mm5q8sg500000gn/T/pip-req-build-mtev6upc Resolved https://github.com/tree-sitter/tree-sitter-python to commit 71778c2a472ed00a64abf4219544edbf8e4b86d7 Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Building wheels for collected packages: tree-sitter-python Building wheel for tree-sitter-python (pyproject.toml) ... done Created wheel for tree-sitter-python: filename=tree_sitter_python-0.21.0-cp38-abi3-macosx_14_0_arm64.whl size=87767 sha256=85229e4ca60dacbda6adb36effb5dadbc63db223e074c8e81e659607562c85bc Stored in directory: /private/var/folders/hm/zmy00t1153s7n35mm5q8sg500000gn/T/pip-ephem-wheel-cache-otx59pik/wheels/7b/ea/62/a91e22123447e77c1f6ca4bf2decdd90535adf4a56719b21bd Successfully built tree-sitter-python Installing collected packages: tree-sitter-python Successfully installed tree-sitter-python-0.21.0