WebFaction
Community site: login faq

I recently migrated an old Django app to a CentOS6 64-bit server, and it's not working because the old psycopg (not psycopg2) library isn't installed.

What are the steps to install the psycopg library on a CentOS6 64-bit server?

This question is marked "community wiki".

asked 12 Jul '12, 15:31

seanf
12.2k41836
accept rate: 37%

edited 12 Jul '12, 15:32


You can install the psycopg library with the following steps. The steps assume that you're using Python 2.5 - if you're using a different version of Python, then adjust as needed:

mkdir -p ~/tmp ~/src ~/lib/python2.5
export TMPDIR=~/tmp
cd ~/src
wget http://downloads.egenix.com/python/egenix-mx-base-3.1.2.tar.gz
tar zxf egenix-mx-base-3.1.2.tar.gz
cd egenix-mx-base-3.1.2
python2.5 setup.py install --home=$HOME
cd ~/src
wget http://initd.org/psycopg/tarballs/PSYCOPG-1-1/psycopg-1.1.21.tar.gz
tar zxf psycopg-1.1.21.tar.gz
cd psycopg-1.1.21
export CPPFLAGS="-DPOSTGRESQL_MAJOR=9 -DPOSTGRESQL_MINOR=1"
./configure --prefix=$HOME --with-python=/usr/local/bin/python2.5 --with-python-version=2.5 --with-postgres-libraries=/usr/pgsql-9.1/lib --with-postgres-includes=/usr/pgsql-9.1/include --with-mxdatetime-includes=$HOME/lib/python2.5/mx/DateTime/mxDateTime
make
cp psycopgmodule.so ~/lib/python2.5/

Note that you should only do this if you need to get an old app working quickly - for the long term, you should update your app to use psycopg2.

permanent link
This answer is marked "community wiki".

answered 12 Jul '12, 15:31

seanf
12.2k41836
accept rate: 37%

wikified 12 Jul '12, 15:32

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×337
×109
×11
×2
×1

question asked: 12 Jul '12, 15:31

question was seen: 3,021 times

last updated: 12 Jul '12, 15:32

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM