1
Compiling and installing psycopg
2
********************************
4
** Important note: if you plan to use psyopg2 in a multithreaed application
5
make sure that your libpq has been compiled with the --with-thread-safety
6
option. psycopg2 will work correctly even with a non-thread-safe libpq but
7
libpq will leak memory.
9
While psycopg 1.x used autoconf for its build process psycopg 2 switched to
10
the more pythoning setup.py. Currently both psycopg's author and distutils
11
have some limitations so the file setup.cfg is almost unused and most build
12
options are hidden in setup.py. Before building psycopg look at setup.cfg file
13
and change any settings to follow your system (or taste); then:
17
to build in the local directory; and:
19
python setup.py install
21
to install system-wide.
24
Using setuptools and EasyInstall
25
================================
27
If setuptools are installed on your system you can easily create an egg for
28
psycopg and install it. Download the source distribution (if you're reading
29
this file you probably already have) and then edit setup.cfg to your taste
30
and build from the source distribution top-level directory using:
35
Compiling under Windows with mingw32
36
====================================
38
You can compile psycopg under Windows platform with mingw32
39
(http://www.mingw.org/) compiler. MinGW is also shipped with IDEs such as
40
Dev-C++ (http://www.bloodshed.net/devcpp.html) and Code::Blocks
41
(http://www.codeblocks.org). gcc binaries should be in your PATH.
43
You need a PostgreSQL with include and libary files installed. At least v8.0 is required.
45
First you need to create a libpython2X.a as described in
46
http://starship.python.net/crew/kernr/mingw32/Notes.html. Then run:
48
python setup.py build_ext --compiler=mingw32 install