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
You should check if you have correct version of python which is over
python 3.9
. I hope this would solve your error.According to this answer you should not have both:
psycopg2
andpsycopg2-binary
of the same version.Try this:
psycopg2
andpsycopg2-binary
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.
You can try updating the PostgreSQL to latest. And see that the version matches with AGE library.
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.The error
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:
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.