7

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.

user1802143
  • 12,254
  • 13
  • 42
  • 50

2 Answers2

6

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

Prashant Sahoo
  • 734
  • 10
  • 16
2

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.

Community
  • 1
  • 1
bjmc
  • 2,441
  • 1
  • 25
  • 38