skip to Main Content

I am trying to install AGE via the python driver but it keeps giving me the same error.

Following the steps on the drivers/python/README.md. I starting getting errors after running

pip install --no-binary:all: psycopg2

it returned:

Failed to build psycopg2
ERROR: Could not build wheels for psycopg2, which is required to install pyproject toml-based projects

I installed psycopg2-binary instead and that went smoothly. However, while running the tests, it returned Exception: Could not deserialize ATN with version...... I tried to install but kept getting one of the errors.

How can I solve this?

6

Answers


  1. You should check if you have correct version of python which is over python 3.9 . I hope this would solve your error.

    Login or Signup to reply.
  2. According to this answer you should not have both: psycopg2 and
    psycopg2-binary of the same version.

    Try this:

    • Uninstall both psycopg2 and psycopg2-binary
    • Install the prerequsisites for building the psycopg2 package from source (Ubuntu):
      Python 3: sudo apt install libpq-dev python3-dev
      Python 2: sudo apt install libpq-dev python-dev

    Then try the build command again:
    pip install psycopg2

    In my case I have psycopg2 version: 2.9.5 and the AGE python driver works fine.

    Login or Signup to reply.
  3. You can try updating the PostgreSQL to latest. And see that the version matches with AGE library.

    Login or Signup to reply.
  4. Since you have python 3.11
    Install libpq library for python3,
    sudo apt install libpq-dev python3-dev
    then
    pip install psycopg2 and it should work fine.

    Login or Signup to reply.
  5. The error

    Exception: Could not deserialize ATN with version.....
    

    when running the tests using psycopg2-binary was becasue of a version mismatch of ANTLR runtime.

    You can reference to a GitHub Issue I posted on the same error. You can solve this error by installing the required ANTLR runtime version as below:

        # When using the apache-age-python package
    pip install antlr4-python3-runtime==4.9.2  
    
        # When importing age from the cloned repository 
    pip install antlr4-python3-runtime==4.11.1
    
    Login or Signup to reply.
  6. The error you’re getting definitely is concerning dependency issues with the package. Firstly, try to install all required dependencies.

    sudo apt-get install build-essential libpq-dev

    This will make sure your dependencies are up to date. Once that’s done you can reinstall psycopg2, the commands for that are:

    pip uninstall psycopg2 pip install psycopg2

    This should help your case. If not, you can always try to install psycopg2 using the source code from git itself.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search