Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.so files built now throws error ValueError: Incompatible Language version 12. Must not be between 9 and 11 #38

Closed
rcshubhadeep opened this issue Oct 3, 2020 · 12 comments
Labels
bug Something isn't working

Comments

@rcshubhadeep
Copy link

I just built a .so file for Python language (using py-tree-sitter) and now then I am trying to use it, it throws an error -

ValueError: Incompatible Language version 12. Must not be between 9 and 11

@issue-label-bot
Copy link

Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.68. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

@issue-label-bot issue-label-bot bot added the bug Something isn't working label Oct 3, 2020
@rcshubhadeep
Copy link
Author

👍

@rcshubhadeep
Copy link
Author

rcshubhadeep commented Oct 3, 2020

I am not sure what I am missing here but I am going to write exact steps I did

1.> Created a fresh virtualenv with Python 3.6.5

2.> installed tree_sitter and ipython in it. Like so - pip3 install --no-cache-dir tree_sitter ipython

3.> Created a directory called vendor

4.> cd into vendor and did git clone https://github.com/tree-sitter/tree-sitter-go and git clone https://github.com/tree-sitter/tree-sitter-python

5.> Opened the ipython prompt

6.> Did exactly the following steps

In [1]: rm -f my-languages.so

In [2]: from tree_sitter import Language, Parser

In [3]: Language.build_library(
   ...:   # Store the library in the `build` directory
   ...:   'my-languages.so',
   ...:
   ...:   # Include one or more languages
   ...:   [
   ...:     'vendor/tree-sitter-go',
            'vendor/tree-sitter-python'
   ...:   ]
   ...: )
Out[3]: True

In [4]: parser = Parser()

In [5]: GO_LANGUAGE = Language('my-languages.so', 'go')

In [6]: parser.set_language(GO_LANGUAGE)

7.> At this point it throws me this error (irrespective whether I am trying to use PY_LANGUAGE or GO_LANGUAGE )

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-6-0310ba5ce61d> in <module>
----> 1 parser.set_language(GO_LANGUAGE)

ValueError: Incompatible Language version 12. Must not be between 9 and 11

What am I missing? What shall I do?

Please help.

Thanks in advance.

@maxbrunsfeld
Copy link
Contributor

This is an incompatibility between the latest version of tree-sitter-python and the older version of tree-sitter that this library was using. I have published a new version, 0.2.0, that should fix this.

@mumar-cybershell
Copy link

I am using tree-sitter-python and tree-sitter-c with 0.2.0, 0.2.1, 0.2.2. Having the same issue
ValueError: Incompatible Language version 13. Must not be between 9 and 12

@gkoumasd
Copy link

I am using tree-sitter-python and tree-sitter-c with 0.2.0, 0.2.1, 0.2.2. Having the same issue
ValueError: Incompatible Language version 13. Must not be between 9 and 12

Hi I am experiencing the same issue, the new version, 0.2.0 does not solve the issue. Any suggestion?

@lunixbochs lunixbochs reopened this Jul 16, 2021
@lunixbochs
Copy link
Collaborator

Reopening - I assume this needs a tree-sitter core submodule version bump. You might be able to do this yourself locally by updating the core/ submodule.

@gkoumasd
Copy link

tree-sitter core submodule version bump

Thank you for the feedback!
I've tried the new version, i.e., 0.2.2 but I still get the same error. How can I update the core/submodule?

@Symbolk
Copy link

Symbolk commented Nov 18, 2021

Same issue for the 0.2.1 installed via pip install tree_sitter, and found several issues related with this (#72, #60):
image

image

@MNaumanBootter
Copy link

MNaumanBootter commented Jan 7, 2022

I am using tree-sitter-python and tree-sitter-c with 0.2.0, 0.2.1, 0.2.2. Having the same issue ValueError: Incompatible Language version 13. Must not be between 9 and 12

Same issue for the 0.2.1 installed via pip install tree_sitter, and found several issues related with this (#72, #60)

Thank you for the feedback! I've tried the new version, i.e., 0.2.2 but I still get the same error. How can I update the core/submodule?

I had the same issue. It was resolved by using tree_sitter version: 0.19.0.

Acutally, 0.19.0 is the latest version in pip right now.

pip install tree_sitter==0.19.0

@maxbrunsfeld
Copy link
Contributor

FYI, I published tree_sitter 0.20 to PyPi. Closing this out because I think it was answered.

@nandishaivalli
Copy link

I was facing the same issue,
ValueError: Incompatible Language version 11. Must be between 13 and 14.

I used different my-languages.so file from here
It helped to solve my issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants