The code is from docs
import tree_sitter_language_pack as tslp
# Parsers download automatically on first use
result = tslp.process(
"def hello():\n print('world')\n",
tslp.ProcessConfig(language="python", structure=True, imports=True),
)
print(f"Language: {result['language']}")
print(f"Functions: {len(result['structure'])}")
after adding the tree-sitter-language-pack package the code should just work and download the treesitter grammar from python. but it doesnt do that. throws the following error instead
Traceback (most recent call last):
File "/Users/shaon.rahman2/Work/kreuzberg/main.py", line 4, in <module>
result = tslp.process(
"def hello():\n print('world')\n",
tslp.ProcessConfig(language="python", structure=True, imports=True),
)
tree_sitter_language_pack.ParseError: Language 'python' not found
The code is from docs
after adding the tree-sitter-language-pack package the code should just work and download the treesitter grammar from python. but it doesnt do that. throws the following error instead