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.

Linux/OSX:

Linux and OSX build status

Windows:

Windows build status

Metadata

Release files for psycopg2 2.9.5

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.5
File Size Uploaded
psycopg2-2.9.5.tar.gz 384.3 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for psycopg2 2.9.5
File
psycopg2-2.9.5-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
psycopg2-2.9.5-cp311-cp311-win32.whl CPython 3.11 CPython 3.11 Windows x86-32 Details
psycopg2-2.9.5-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
psycopg2-2.9.5-cp310-cp310-win32.whl CPython 3.10 CPython 3.10 Windows x86-32 Details
psycopg2-2.9.5-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details
psycopg2-2.9.5-cp39-cp39-win32.whl CPython 3.9 CPython 3.9 Windows x86-32 Details
psycopg2-2.9.5-cp38-cp38-win_amd64.whl CPython 3.8 CPython 3.8 Windows x86-64 Details
psycopg2-2.9.5-cp38-cp38-win32.whl CPython 3.8 CPython 3.8 Windows x86-32 Details
psycopg2-2.9.5-cp37-cp37m-win_amd64.whl CPython 3.7 CPython 3.7 pymalloc Windows x86-64 Details
psycopg2-2.9.5-cp37-cp37m-win32.whl CPython 3.7 CPython 3.7 pymalloc Windows x86-32 Details
psycopg2-2.9.5-cp36-cp36m-win_amd64.whl CPython 3.6 CPython 3.6 pymalloc Windows x86-64 Details
psycopg2-2.9.5-cp36-cp36m-win32.whl CPython 3.6 CPython 3.6 pymalloc Windows x86-32 Details

Total release size: 13.4 MB

Release files / psycopg2-2.9.5.tar.gz

Download URL psycopg2-2.9.5.tar.gz
Size 384.3 kB
Tags Source
SHA-256 checksum
How to use checksums
a5246d2e683a972e2187a8714b5c2cf8156c064629f9a9b1a873c1730d9e245a
BLAKE2b-256 checksum
How to use checksums
89d6cd8c46417e0f7a16b4b0fc321f4ab676a59250d08fce5b64921897fb07cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.10

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

Download URL psycopg2-2.9.5-cp311-cp311-win_amd64.whl
Size 1.2 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
920bf418000dd17669d2904472efeab2b20546efd0548139618f8fa305d1d7ad
BLAKE2b-256 checksum
How to use checksums
23b2679ba212dd7fc5f726913053756b23344d5520b4fa49c2a93af31d0f4508
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.10

Release files / psycopg2-2.9.5-cp311-cp311-win32.whl

Download URL psycopg2-2.9.5-cp311-cp311-win32.whl
Size 1.0 MB
Tags CPython 3.11 Windows x86-32
SHA-256 checksum
How to use checksums
093e3894d2d3c592ab0945d9eba9d139c139664dcf83a1c440b8a7aa9bb21955
BLAKE2b-256 checksum
How to use checksums
9f1fdf4c9ab12634dc89c71c2184b2524adccd804af2bacc8968a7c831642338
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.10

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

Download URL psycopg2-2.9.5-cp310-cp310-win_amd64.whl
Size 1.2 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
4cb9936316d88bfab614666eb9e32995e794ed0f8f6b3b718666c22819c1d7ee
BLAKE2b-256 checksum
How to use checksums
af4f3abf262dc49cb70c2fbb6d38a9a8956a0c79ba2d102e457958bc4f21660f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.10

Release files / psycopg2-2.9.5-cp310-cp310-win32.whl

Download URL psycopg2-2.9.5-cp310-cp310-win32.whl
Size 1.0 MB
Tags CPython 3.10 Windows x86-32
SHA-256 checksum
How to use checksums
d3ef67e630b0de0779c42912fe2cbae3805ebaba30cda27fea2a3de650a9414f
BLAKE2b-256 checksum
How to use checksums
045100ed720de223485a56c28b404747b96806679e720f4c97a75bdd556a01f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.10

Release files / psycopg2-2.9.5-cp39-cp39-win_amd64.whl

Download URL psycopg2-2.9.5-cp39-cp39-win_amd64.whl
Size 1.2 MB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
190d51e8c1b25a47484e52a79638a8182451d6f6dff99f26ad9bd81e5359a0fa
BLAKE2b-256 checksum
How to use checksums
10dba34baee6275fcc371ecdb30040042ed2a548f18c29339ea9ca2406a35cba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.10

Release files / psycopg2-2.9.5-cp39-cp39-win32.whl

Download URL psycopg2-2.9.5-cp39-cp39-win32.whl
Size 1.0 MB
Tags CPython 3.9 Windows x86-32
SHA-256 checksum
How to use checksums
322fd5fca0b1113677089d4ebd5222c964b1760e361f151cbb2706c4912112c5
BLAKE2b-256 checksum
How to use checksums
c8809c4a7f453fbef2acc65a66f79def6b048787f5ff82005682a98252311e68
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.10

Release files / psycopg2-2.9.5-cp38-cp38-win_amd64.whl

Download URL psycopg2-2.9.5-cp38-cp38-win_amd64.whl
Size 1.2 MB
Tags CPython 3.8 Windows x86-64
SHA-256 checksum
How to use checksums
1a5c7d7d577e0eabfcf15eb87d1e19314c8c4f0e722a301f98e0e3a65e238b4e
BLAKE2b-256 checksum
How to use checksums
7e4898e0d097fc23d772f525f54b3c62becadf839f2f84ee6600e283dde5dfe7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.10

Release files / psycopg2-2.9.5-cp38-cp38-win32.whl

Download URL psycopg2-2.9.5-cp38-cp38-win32.whl
Size 1.0 MB
Tags CPython 3.8 Windows x86-32
SHA-256 checksum
How to use checksums
f5b6320dbc3cf6cfb9f25308286f9f7ab464e65cfb105b64cc9c52831748ced2
BLAKE2b-256 checksum
How to use checksums
b4f4c45a12b538c1ef9e36681d2ddec7d397961bdd9ba53de01bdce32acdb348
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.10

Release files / psycopg2-2.9.5-cp37-cp37m-win_amd64.whl

Download URL psycopg2-2.9.5-cp37-cp37m-win_amd64.whl
Size 1.2 MB
Tags CPython 3.7 CPython 3.7 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
1e5a38aa85bd660c53947bd28aeaafb6a97d70423606f1ccb044a03a1203fe4a
BLAKE2b-256 checksum
How to use checksums
d1c5ff268400b5fae84d8070e7b7a8c9425c635a24a68eee587f86adcf11bb13
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.10

Release files / psycopg2-2.9.5-cp37-cp37m-win32.whl

Download URL psycopg2-2.9.5-cp37-cp37m-win32.whl
Size 999.7 kB
Tags CPython 3.7 CPython 3.7 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
922cc5f0b98a5f2b1ff481f5551b95cd04580fd6f0c72d9b22e6c0145a4840e0
BLAKE2b-256 checksum
How to use checksums
835cfe9e713ef1d352fbaae0ecdae05a9882ad9466f46100a8aa2962d858e62a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.10

Release files / psycopg2-2.9.5-cp36-cp36m-win_amd64.whl

Download URL psycopg2-2.9.5-cp36-cp36m-win_amd64.whl
Size 1.2 MB
Tags CPython 3.6 CPython 3.6 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
fc04dd5189b90d825509caa510f20d1d504761e78b8dfb95a0ede180f71d50e5
BLAKE2b-256 checksum
How to use checksums
c2e75cf79928c362cd661765a18d7015b2e0b48f01d9a41dad42d7d945c11a93
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.10

Release files / psycopg2-2.9.5-cp36-cp36m-win32.whl

Download URL psycopg2-2.9.5-cp36-cp36m-win32.whl
Size 999.8 kB
Tags CPython 3.6 CPython 3.6 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
b9ac1b0d8ecc49e05e4e182694f418d27f3aedcfca854ebd6c05bb1cffa10d6d
BLAKE2b-256 checksum
How to use checksums
aef4b01b7d33f5456e26b3f41fd13c93aa1c58528e3306d801133ec81dfcd81a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.10

Release history Release notifications | RSS feed

2.9.12

7 release files

2.9.11

7 release files

2.9.8

11 release files

This release

2.9.5 This release

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