Skip to main content

Psycopg is the most popular PostgreSQL database adapter for the Python programming language. Its main features are the complete implementation of the Python DB API 2.0 specification and the thread safety (several threads can share the same connection). It was designed for heavily multi-threaded applications that create and destroy lots of cursors and make a large number of concurrent “INSERT”s or “UPDATE”s.

Psycopg 2 is mostly implemented in C as a libpq wrapper, resulting in being both efficient and secure. It features client-side and server-side cursors, asynchronous communication and notifications, “COPY TO/COPY FROM” support. Many Python types are supported out-of-the-box and adapted to matching PostgreSQL data types; adaptation can be extended and customized thanks to a flexible objects adaptation system.

Psycopg 2 is both Unicode and Python 3 friendly.

Documentation

Documentation is included in the doc directory and is available online.

For any other resource (source code repository, bug tracker, mailing list) please check the project homepage.

Installation

Building Psycopg requires a few prerequisites (a C compiler, some development packages): please check the install and the faq documents in the doc dir or online for the details.

If prerequisites are met, you can install psycopg like any other Python package, using pip to download it from PyPI:

$ pip install psycopg2

or using setup.py if you have downloaded the source package locally:

$ python setup.py build
$ sudo python setup.py install

You can also obtain a stand-alone package, not requiring a compiler or external libraries, by installing the psycopg2-binary package from PyPI:

$ pip install psycopg2-binary

The binary package is a practical choice for development and testing but in production it is advised to use the package built from sources.

Build status:

Build status

Metadata

Release files for psycopg2 2.9.13

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for psycopg2 2.9.13
File Size Uploaded
psycopg2-2.9.13.tar.gz 378.1 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for psycopg2 2.9.13
File
psycopg2-2.9.13-cp315-cp315-win_amd64.whl CPython 3.15 CPython 3.15 Windows x86-64 Details
psycopg2-2.9.13-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details
psycopg2-2.9.13-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details
psycopg2-2.9.13-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
psycopg2-2.9.13-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
psycopg2-2.9.13-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details

Total release size: 17.2 MB

Release files / psycopg2-2.9.13.tar.gz

Download URL psycopg2-2.9.13.tar.gz
Size 378.1 kB
Tags Source
SHA-256 checksum
How to use checksums
d36784fc2dae69523ba4b79c7d1d1b4d6e83e87836874f111262f4db940b16a6
BLAKE2b-256 checksum
How to use checksums
91816ea19b8b28feb9405c8c87a307776614d6e404bdb98467d1ce10a39d2c1d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.12

Release files / psycopg2-2.9.13-cp315-cp315-win_amd64.whl

Download URL psycopg2-2.9.13-cp315-cp315-win_amd64.whl
Size 2.9 MB
Tags CPython 3.15 Windows x86-64
SHA-256 checksum
How to use checksums
0d2fc7eedfaca0586dcf1476454598428d0d8471d3b5cb55f92015a5f9d0af40
BLAKE2b-256 checksum
How to use checksums
440fda6a374ed5e3b4040c53b29ab57b8b26c0872900cf8aed2265790889a1e3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.12

Release files / psycopg2-2.9.13-cp314-cp314-win_amd64.whl

Download URL psycopg2-2.9.13-cp314-cp314-win_amd64.whl
Size 2.9 MB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
a6f54fd8e0024f35240866b5dfff9ead2a0dbd33b8096eec438bc6093412842d
BLAKE2b-256 checksum
How to use checksums
b9f9f6e9d47ea04e09282c618f5eeb67634f39ea4b04acedd0a6d8da4d986d50
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.12

Release files / psycopg2-2.9.13-cp313-cp313-win_amd64.whl

Download URL psycopg2-2.9.13-cp313-cp313-win_amd64.whl
Size 2.8 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
165e25c1b0e616a1f28080c5c68bd2dc015051d83c90240b2171d3e76ca2b5ff
BLAKE2b-256 checksum
How to use checksums
e1a5a01216e7c2e477052469c0317a4e71e031293830c9882ca372bae167bec3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.12

Release files / psycopg2-2.9.13-cp312-cp312-win_amd64.whl

Download URL psycopg2-2.9.13-cp312-cp312-win_amd64.whl
Size 2.8 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
10f7408b34412e8c0d4f8b1565541f1d651b1d00447857e5d8561b38f5c1a738
BLAKE2b-256 checksum
How to use checksums
4e8a820b2f5ec521db28b5f113d7d64b0264f775fef611265039ba0cb5101858
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.12

Release files / psycopg2-2.9.13-cp311-cp311-win_amd64.whl

Download URL psycopg2-2.9.13-cp311-cp311-win_amd64.whl
Size 2.8 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
d16e7a5f5e400ac51ca953d42255804eff6c8a9650b1a2074f6ca6261d740382
BLAKE2b-256 checksum
How to use checksums
795131d303c9aec410b853861077acc7a9b1f0a5b43f003061f748ab486735f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.12

Release files / psycopg2-2.9.13-cp310-cp310-win_amd64.whl

Download URL psycopg2-2.9.13-cp310-cp310-win_amd64.whl
Size 2.8 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
7d48416f6a4823ada9b33771085331b842b553df88435701bff5ddb4469905de
BLAKE2b-256 checksum
How to use checksums
4db9c29fb26fd2a98a5a65674f638e6ad989bc8742e62947ebde2cff88cf3988
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.12

Release history Release notifications | RSS feed

This release

2.9.13 This release

7 release files

2.9.12

7 release files

2.9.11

7 release files

2.9.8

11 release files

2.9.5

13 release files

2.9.3

11 release files

2.9.2

11 release files

2.9.1

11 release files

2.9

9 release files

2.8.4

13 release files

2.8.3

11 release files

2.8.2

11 release files

2.8

11 release files

2.7.7

30 release files

2.7.5

30 release files

2.7.3

31 release files

2.7.2

31 release files

2.7.1

31 release files

2.7

31 release files

2.6.1

11 release files

2.6

1 release file

2.5.5

1 release file

2.5.4

1 release file

2.5.3

1 release file

2.5.2

1 release file

2.5.1

1 release file

2.5

1 release file

2.4.6

1 release file

2.4.5

1 release file

2.4.4

1 release file

2.4.3

1 release file

2.4.2

1 release file

2.4.1

1 release file

2.4

1 release file

2.3.2

1 release file

2.3.1

1 release file

2.3.0

1 release file

2.2.2

1 release file

2.2.1

1 release file

2.2.0

1 release file

2.0.14

1 release file

2.0.13

1 release file

2.0.12

1 release file

2.0.11

1 release file

2.0.10

1 release file

2.0.8

2.0.7

2.0.6

2.0.5.1

2.0.4

2.0.3

2.0.2

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page