Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

latest version of psycopg2 on aws

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.

like image 870
user1802143 Avatar asked Dec 17 '13 23:12

user1802143


People also ask

What is AWS psycopg2?

psycopg2 Python Library for AWS Lambda This is a custom compiled psycopg2 C library for Python. Due to AWS Lambda missing the required PostgreSQL libraries in the AMI image, we needed to compile psycopg2 with the PostgreSQL libpq.so library statically linked libpq library instead of the default dynamic link.

Is psycopg2 the same as psycopg2-binary?

psycopg2-binary and psycopg2 both give us the same code that we interact with. The difference between the two is in how that code is installed in our computer.

What is Python3 psycopg2?

Python 3 module for PostgreSQL psycopg is a PostgreSQL database adapter for the Python3 programming language (just like pygresql and popy.) This is version 2, a complete rewrite of the original code to provide new-style classes for connection and cursor objects and other sweet candies.


2 Answers

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

like image 138
Prashant Sahoo Avatar answered Sep 26 '22 03:09

Prashant Sahoo


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.

like image 28
bjmc Avatar answered Sep 26 '22 03:09

bjmc