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

Python driver unable to build from source #388

Closed
Hunaid2000 opened this issue Dec 13, 2022 · 5 comments
Closed

Python driver unable to build from source #388

Hunaid2000 opened this issue Dec 13, 2022 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@Hunaid2000
Copy link
Contributor

Describe the bug
When building from source (following instructions in Readme) it says
Exception: Could not deserialize ATN with version ♥ (expected 4)

Unable to build when package antlr4-python3-runtime installed is version 4.10 or above

The issue was also referred in apache-age-python PyPi package repository rhizome-ai/apache-age-python#18

How are you accessing AGE (Command line, driver, etc.)?

  • Command line
  • Python Driver

What data setup do we need to do?

  • Install all required packages given in setup.py or Readme (psycopg2 and antlr4-python3-runtime)

What is the necessary configuration info needed?

  • Install antlr4-python3-runtime version 4.10 or above to test the error

What is the command that caused the error?

python setup.py install
Traceback (most recent call last):
  File "C:\Users\hunai\Desktop\AGE\age\drivers\python\setup.py", line 17, in <module>
    from age import VERSION
  File "C:\Users\hunai\Desktop\AGE\age\drivers\python\age\__init__.py", line 16, in <module>
    from . import age
  File "C:\Users\hunai\Desktop\AGE\age\drivers\python\age\age.py", line 22, in <module>    from .builder import ResultHandler , parseAgeValue, newResultHandler
  File "C:\Users\hunai\Desktop\AGE\age\drivers\python\age\builder.py", line 16, in <module>
    from .gen.AgtypeLexer import AgtypeLexer
  File "C:\Users\hunai\Desktop\AGE\age\drivers\python\age\gen\AgtypeLexer.py", line 106, in <module>
    class AgtypeLexer(Lexer):
  File "C:\Users\hunai\Desktop\AGE\age\drivers\python\age\gen\AgtypeLexer.py", line 108, in AgtypeLexer
    atn = ATNDeserializer().deserialize(serializedATN())
  File "C:\Users\hunai\AppData\Local\Programs\Python\Python310\lib\site-packages\antlr4\atn\ATNDeserializer.py", line 28, in deserialize
    self.checkVersion()
  File "C:\Users\hunai\AppData\Local\Programs\Python\Python310\lib\site-packages\antlr4\atn\ATNDeserializer.py", line 50, in checkVersion
    raise Exception("Could not deserialize ATN with version " + str(version) + " (expected " + str(SERIALIZED_VERSION) + ").")
Exception: Could not deserialize ATN with version ♥ (expected 4).

Expected behavior
Should be able to successfully build from source.

Environment (please complete the following information):

  • Version: 1.1.0

Documentation of apache-age-python package should also be updated.

@Hunaid2000
Copy link
Contributor Author

Hunaid2000 commented Dec 13, 2022

PR for the issue here #389. Kindly look into it. If any changes are required, do let me know.

@jrgemignani
Copy link
Contributor

@dehowef Can you take a look as you have been working on the Python driver?

@dehowef
Copy link
Member

dehowef commented Jan 3, 2023

Hello, yeah this is an issue with the Python driver. You need a specific version of ANTLR for it to work-- I think the version is 4.9.2. It's in the documentation, you have to use:

pip install antlr4-python3-runtime==4.9.2

Hope this helps

@jrgemignani @Hunaid2000

@Hunaid2000
Copy link
Contributor Author

Hunaid2000 commented Jan 3, 2023

Thanks for your reply @dehowef.

How about if we move all dependencies/packages to requirements.txt file? It would make it easier for user to install all packages with one line and give developers more control over required packages (along with their required versions). Your guidance on this would be helpful.

I submitted a PR (mentioned in my earlier comment) that contains following changes:

  • Resolves this issue (with requirements.txt)
  • Fixed typo in exceptions.py
  • Fixed ambiguity in README (It instructs user to run tests first and then clone the repo. Should have been opposite)

@dehowef Kindly have look into it and let me know if I should close this issue and PR now.

dehowef pushed a commit that referenced this issue Jan 5, 2023
* Fixed a bug where python driver throws error when build from source

* Moved required packages to requirements.txt

* Update Readme

Rearranged instructions and added instructions to install from requirements.txt

* Fixed a typo in exceptions.py file

Fixed a typo 'SqlExcution' on line 62 in exceptions.py file
@Hunaid2000
Copy link
Contributor Author

Hunaid2000 commented Jan 5, 2023

Resolved in PR #389.

jrgemignani pushed a commit that referenced this issue Jan 5, 2023
* Fixed a bug where python driver throws error when build from source

* Moved required packages to requirements.txt

* Update Readme

Rearranged instructions and added instructions to install from requirements.txt

* Fixed a typo in exceptions.py file

Fixed a typo 'SqlExcution' on line 62 in exceptions.py file
jrgemignani pushed a commit that referenced this issue Jan 6, 2023
* Fixed a bug where python driver throws error when build from source

* Moved required packages to requirements.txt

* Update Readme

Rearranged instructions and added instructions to install from requirements.txt

* Fixed a typo in exceptions.py file

Fixed a typo 'SqlExcution' on line 62 in exceptions.py file
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

3 participants