tree-sitter / py-tree-sitter

Python bindings to the Tree-sitter parsing library
https://tree-sitter.github.io/py-tree-sitter/
MIT License
817 stars 96 forks source link

ModuleNotFoundError : No Module named 'tree_sitter._binding' #280

Closed nevermet closed 2 weeks ago

nevermet commented 3 weeks ago

I am following the readme page.

I did pip install tree-sitter pip install tree-sitter-python .

After running this line: from tree_sitter import Language, Parser , I got this message: ModuleNotFoundError : No Module named 'tree_sitter._binding' .

Could you tell me how I can resolve this error?

Thanks in advance.

ObserverOfTime commented 3 weeks ago

What's your system?

nevermet commented 3 weeks ago

What's your system?

It's an ubuntu (20.04) with python 3.12.5.

ObserverOfTime commented 3 weeks ago

Post the output of

pip install --force-reinstall --verbose tree-sitter
nevermet commented 2 weeks ago

Post the output of

pip install --force-reinstall --verbose tree-sitter

After running the command, following messages came out: ... Successfully un-installed tree-sitter-0.22.3 Successfully installed tree-sitter-0.22.3

After this, I could run the import line without any error message.

Thank you!