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