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

Release files for psycopg2 2.9.2

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.2
File Size Uploaded
psycopg2-2.9.2.tar.gz 380.3 kB Details

Built distributions (wheels)

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

Total release size: 11.2 MB

Release files / psycopg2-2.9.2.tar.gz

Download URL psycopg2-2.9.2.tar.gz
Size 380.3 kB
Tags Source
SHA-256 checksum
How to use checksums
a84da9fa891848e0270e8e04dcca073bc9046441eeb47069f5c0e36783debbea
BLAKE2b-256 checksum
How to use checksums
33ed79434011d773e5ea4c51262f6ebfb86680c2908d7677f31ebccd5aa9f1b3
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.2-cp310-cp310-win_amd64.whl

Download URL psycopg2-2.9.2-cp310-cp310-win_amd64.whl
Size 1.2 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
dfc32db6ce9ecc35a131320888b547199f79822b028934bb5b332f4169393e15
BLAKE2b-256 checksum
How to use checksums
0cef118fa3db352a1fe05b66b2ffda041817caa258a1af223a8cb8a2bf51d565
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.2-cp310-cp310-win32.whl

Download URL psycopg2-2.9.2-cp310-cp310-win32.whl
Size 1.0 MB
Tags CPython 3.10 Windows x86-32
SHA-256 checksum
How to use checksums
6796ac614412ce374587147150e56d03b7845c9e031b88aacdcadc880e81bb38
BLAKE2b-256 checksum
How to use checksums
6f47a4c4f503a0b74e80747cdf769cc5df1d147eb945c6072c9359b8fdd7efa7
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.2-cp39-cp39-win_amd64.whl

Download URL psycopg2-2.9.2-cp39-cp39-win_amd64.whl
Size 1.2 MB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
fd7ddab7d6afee4e21c03c648c8b667b197104713e57ec404d5b74097af21e31
BLAKE2b-256 checksum
How to use checksums
39c734b02adbcae31de7cc1540f93cf9d795833d87546ca937afd7dfc94f2579
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.2-cp39-cp39-win32.whl

Download URL psycopg2-2.9.2-cp39-cp39-win32.whl
Size 1.0 MB
Tags CPython 3.9 Windows x86-32
SHA-256 checksum
How to use checksums
a761b60da0ecaf6a9866985bcde26327883ac3cdb90535ab68b8d784f02b05ef
BLAKE2b-256 checksum
How to use checksums
ed69beb6a64cf5f11209a950efa957427e6ca85e6e7b7308a6af4287f8fcc23d
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.2-cp38-cp38-win_amd64.whl

Download URL psycopg2-2.9.2-cp38-cp38-win_amd64.whl
Size 1.1 MB
Tags CPython 3.8 Windows x86-64
SHA-256 checksum
How to use checksums
91c7fd0fe9e6c118e8ff5b665bc3445781d3615fa78e131d0b4f8c85e8ca9ec8
BLAKE2b-256 checksum
How to use checksums
b94401b2c2503607ad4e2885aa817e8b492aa7e538a4d33ea250504fae30f9aa
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.2-cp38-cp38-win32.whl

Download URL psycopg2-2.9.2-cp38-cp38-win32.whl
Size 995.6 kB
Tags CPython 3.8 Windows x86-32
SHA-256 checksum
How to use checksums
77b9105ef37bc005b8ffbcb1ed6d8685bb0e8ce84773738aa56421a007ec5a7a
BLAKE2b-256 checksum
How to use checksums
1d83cc07e4c889449bc385828bf0c540557bccf61554b31950d441b4ba902214
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.2-cp37-cp37m-win_amd64.whl

Download URL psycopg2-2.9.2-cp37-cp37m-win_amd64.whl
Size 1.1 MB
Tags CPython 3.7 CPython 3.7 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
26322c3f114de1f60c1b0febf8fdd595c221b4f624524178f515d07350a71bd1
BLAKE2b-256 checksum
How to use checksums
37243a05a64817bf33b333eed564d96e272a005e0e019d6287a38e6938b358e8
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.2-cp37-cp37m-win32.whl

Download URL psycopg2-2.9.2-cp37-cp37m-win32.whl
Size 994.0 kB
Tags CPython 3.7 CPython 3.7 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
b8816c6410fa08d2a022e4e38d128bae97c1855e176a00493d6ec62ccd606d57
BLAKE2b-256 checksum
How to use checksums
85c318898553fcd5a31aa38f3b8797d6697774a9913934ae49665cc9ecf0821f
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.2-cp36-cp36m-win_amd64.whl

Download URL psycopg2-2.9.2-cp36-cp36m-win_amd64.whl
Size 1.1 MB
Tags CPython 3.6 CPython 3.6 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
f65cba7924363e0d2f416041b48ff69d559548f2cb168ff972c54e09e1e64db8
BLAKE2b-256 checksum
How to use checksums
04bea3e919cf8ccf6258d70d8999acf178a980c3cd2cfa896f5466c9746ca441
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.2-cp36-cp36m-win32.whl

Download URL psycopg2-2.9.2-cp36-cp36m-win32.whl
Size 994.1 kB
Tags CPython 3.6 CPython 3.6 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
77d09a79f9739b97099d2952bbbf18eaa4eaf825362387acbb9552ec1b3fa228
BLAKE2b-256 checksum
How to use checksums
58a24755d91ab657502ff4e2393ebc4a07ed2dbe15ead90ead4a1af2adc9a0d4
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

2.9.5

13 release files

2.9.3

11 release files

This release

2.9.2 This release

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