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.4

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.4
File Size Uploaded
psycopg2-2.9.4.tar.gz 384.0 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for psycopg2 2.9.4
File
psycopg2-2.9.4-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
psycopg2-2.9.4-cp310-cp310-win32.whl CPython 3.10 CPython 3.10 Windows x86-32 Details
psycopg2-2.9.4-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details
psycopg2-2.9.4-cp39-cp39-win32.whl CPython 3.9 CPython 3.9 Windows x86-32 Details
psycopg2-2.9.4-cp38-cp38-win_amd64.whl CPython 3.8 CPython 3.8 Windows x86-64 Details
psycopg2-2.9.4-cp38-cp38-win32.whl CPython 3.8 CPython 3.8 Windows x86-32 Details
psycopg2-2.9.4-cp37-cp37m-win_amd64.whl CPython 3.7 CPython 3.7 pymalloc Windows x86-64 Details
psycopg2-2.9.4-cp37-cp37m-win32.whl CPython 3.7 CPython 3.7 pymalloc Windows x86-32 Details
psycopg2-2.9.4-cp36-cp36m-win_amd64.whl CPython 3.6 CPython 3.6 pymalloc Windows x86-64 Details
psycopg2-2.9.4-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.4.tar.gz

Download URL psycopg2-2.9.4.tar.gz
Size 384.0 kB
Tags Source
SHA-256 checksum
How to use checksums
d529926254e093a1b669f692a3aa50069bc71faf5b0ecd91686a78f62767d52f
BLAKE2b-256 checksum
How to use checksums
8dd7277e23b708a0429b6b3d50e86e52b791156dfbfa81917d34ef6d7b435b84
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.10

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

Download URL psycopg2-2.9.4-cp310-cp310-win_amd64.whl
Size 1.2 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
1da77c061bdaab450581458932ae5e469cc6e36e0d62f988376e9f513f11cb5c
BLAKE2b-256 checksum
How to use checksums
5c0588fa2be0148f2afd0f576272964b83b18be227a965331ff82f1f58be89eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.10

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

Download URL psycopg2-2.9.4-cp310-cp310-win32.whl
Size 1.0 MB
Tags CPython 3.10 Windows x86-32
SHA-256 checksum
How to use checksums
8de6a9fc5f42fa52f559e65120dcd7502394692490c98fed1221acf0819d7797
BLAKE2b-256 checksum
How to use checksums
d050b951e86f3fe09e35cc648b32ece2b0db5ac58f2471345531705a7ae71937
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.10

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

Download URL psycopg2-2.9.4-cp39-cp39-win_amd64.whl
Size 1.2 MB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
849bd868ae3369932127f0771c08d1109b254f08d48dc42493c3d1b87cb2d308
BLAKE2b-256 checksum
How to use checksums
bfe3defe7f0d2418dc9f18245f004047ac48312037f7d9e4d02fbdfe66dc18f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.10

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

Download URL psycopg2-2.9.4-cp39-cp39-win32.whl
Size 1.0 MB
Tags CPython 3.9 Windows x86-32
SHA-256 checksum
How to use checksums
07b90a24d5056687781ddaef0ea172fd951f2f7293f6ffdd03d4f5077801f426
BLAKE2b-256 checksum
How to use checksums
d1ba7d4df3b6975a3ab3174f84681ce13de718f31b334c29bff4daca5ab48134
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.10

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

Download URL psycopg2-2.9.4-cp38-cp38-win_amd64.whl
Size 1.1 MB
Tags CPython 3.8 Windows x86-64
SHA-256 checksum
How to use checksums
c7fa041b4acb913f6968fce10169105af5200f296028251d817ab37847c30184
BLAKE2b-256 checksum
How to use checksums
2074ab9c9076107de13f70bff1c31a66f1327bbe90f5c8c950305a733f20fef9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.10

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

Download URL psycopg2-2.9.4-cp38-cp38-win32.whl
Size 997.5 kB
Tags CPython 3.8 Windows x86-32
SHA-256 checksum
How to use checksums
839f9ea8f6098e39966d97fcb8d08548fbc57c523a1e27a1f0609addf40f777c
BLAKE2b-256 checksum
How to use checksums
206c1eda000a7f71e08f0ce99a0e6c8a1ab5eaa292bfc6bcbcc0b69685b99d5a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.10

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

Download URL psycopg2-2.9.4-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
aa184d551a767ad25df3b8d22a0a62ef2962e0e374c04f6cbd1204947f540d61
BLAKE2b-256 checksum
How to use checksums
877264d073755a80e835f2558c6583151f980ff4e4e47ab2f19570da2b7ebb87
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.10

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

Download URL psycopg2-2.9.4-cp37-cp37m-win32.whl
Size 995.6 kB
Tags CPython 3.7 CPython 3.7 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
aafa96f2da0071d6dd0cbb7633406d99f414b40ab0f918c9d9af7df928a1accb
BLAKE2b-256 checksum
How to use checksums
fe129739036b90fa146af6b80c0b64e6f2aeed01bb1d7e30dfc20482b008c4d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.10

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

Download URL psycopg2-2.9.4-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
46361c054df612c3cc813fdb343733d56543fb93565cff0f8ace422e4da06acb
BLAKE2b-256 checksum
How to use checksums
4d190e1b6050b99be7aaae32926748c83852097df0e4964fcee0eea57bb4cbfe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.10

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

Download URL psycopg2-2.9.4-cp36-cp36m-win32.whl
Size 995.7 kB
Tags CPython 3.6 CPython 3.6 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
a11946bad3557ca254f17357d5a4ed63bdca45163e7a7d2bfb8e695df069cc3a
BLAKE2b-256 checksum
How to use checksums
434712c263c144062fde71f0d71d03f5eb876b7e07a7bc99b552a44e1f7c13e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 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

This release

2.9.4 This release

11 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