latest version of psycopg2 on aws
Asked Answered
W

3

10

I am trying to get the latest version of psycopg2 on my aws instance. I noticed that the latest version was 2.4.6 but I could only get 2.0.14 on aws. Is there a way to get the latest version? There are some features I need that are not supported in the earlier versions.

Wellfavored answered 17/12, 2013 at 23:28 Comment(0)
S
8

Working answer as of November 2022:

sudo yum install postgresql-devel python3-devel
pip install wheel
pip install psycopg2

If you are still using Python 2 then use python-devel instead of python3-devel.

The pip install wheel is not strictly necessary, but psycopg2 prefers it and it wasn't installed yet in my environment.

Smoko answered 10/11, 2022 at 19:5 Comment(1)
hero!!! This is the real answerLaicize
M
7

This works for me in Amazon aws-cli/1.9.11 Python/2.7.10 Linux/4.1.10 and Ubuntu 14

If pip not installed in your Amazon AWS machine type:

$ sudo yum install python-pip

and then type below commands:

$ sudo yum update

$ sudo yum install libpq-dev python-dev

$ sudo pip install psycopg2

Then you will get message like below :

You are using pip version 6.1.1, however version 7.1.2 is available. You should consider upgrading via the 'pip install --upgrade pip' command. Collecting psycopg2 Downloading psycopg2-2.6.1.tar.gz (371kB) 100% |████████████████████████████████| 372kB 1.3MB/s Installing collected packages: psycopg2 Running setup.py install for psycopg2 Successfully installed psycopg2-2.6.1


If pip not installed in your Ubuntu machine type:

$ sudo apt-get install python-pip

and then type below commands:

$ sudo apt-get update

$ sudo apt-get install libpq-dev python-dev

$ sudo pip install psycopg2

Then you will get message like below :

You are using pip version 6.1.1, however version 7.1.2 is available. You should consider upgrading via the 'pip install --upgrade pip' command. Collecting psycopg2 Downloading psycopg2-2.6.1.tar.gz (371kB) 100% |████████████████████████████████| 372kB 1.3MB/s Installing collected packages: psycopg2 Running setup.py install for psycopg2 Successfully installed psycopg2-2.6.1

Misdate answered 8/1, 2016 at 9:18 Comment(2)
On Amazon Linux 2 it is actually sudo yum install postgresql-develVernonvernor
for python3?? now syas No package libpq-dev availableIngenue
L
4

If you need a more recent version of psycopg2 on your EC2 instance, you can install it directly with pip using: $ pip install psycopg2

You may need to first install the python-dev and libpq-dev libraries as explained in this StackOverflow question.

Lissotrichous answered 16/6, 2014 at 22:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.