Skip to content

bug: Treesitter language pack is not installed automatically #90

@Wizdore

Description

@Wizdore

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions