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

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
File Size Uploaded
psycopg2-2.9.tar.gz 379.8 kB Details

Built distributions (wheels)

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

Total release size: 9.0 MB

Release files / psycopg2-2.9.tar.gz

Download URL psycopg2-2.9.tar.gz
Size 379.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b12073fdf2002e828e5921be2c39ff9c6eab361c5c0bd6c529619fc23677accc
BLAKE2b-256 checksum
How to use checksums
6c796df8af2405e2aa60732c47757453fc7fa4af5c90a1796b3392ef892d3a52
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.5

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

Download URL psycopg2-2.9-cp39-cp39-win_amd64.whl
Size 1.2 MB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
8f4c1800e57ad128d20b2e91d222ca238fffd316cef65be781361cdf35e37979
BLAKE2b-256 checksum
How to use checksums
fba1a973f7b7498577a5243ab568776dbb8627724808779080295fde4ed066bc
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.5

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

Download URL psycopg2-2.9-cp39-cp39-win32.whl
Size 1.0 MB
Tags CPython 3.9 Windows x86-32
SHA-256 checksum
How to use checksums
e44e39a46af7c30566b7667fb27e701e652ab0a51e05c263a01d3ff0e223b765
BLAKE2b-256 checksum
How to use checksums
65007417e52499a1c3b5f5755a29e0cf6eb0851543366504ad6731825478fedf
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.5

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

Download URL psycopg2-2.9-cp38-cp38-win_amd64.whl
Size 1.1 MB
Tags CPython 3.8 Windows x86-64
SHA-256 checksum
How to use checksums
d549db98fc0e6db41a2aa0d65f7434c4308a9f64012adb209b9e489f26fe87c6
BLAKE2b-256 checksum
How to use checksums
d1a1756fcd30d06a3b013033104fd9ac0e64bf0658c40c0630e23560dd732160
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.5

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

Download URL psycopg2-2.9-cp38-cp38-win32.whl
Size 995.9 kB
Tags CPython 3.8 Windows x86-32
SHA-256 checksum
How to use checksums
03a485bf71498870e38b535c0e6e7162d6ac06a91487edddc3b959894d65f79c
BLAKE2b-256 checksum
How to use checksums
4fc66eb71bf334a6f97e68b6ca16633cad1f46accf0be428db264efb2c57f878
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.5

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

Download URL psycopg2-2.9-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
22102cfeb904898254f287b1a77360bf66c636858e7476593acd5267e5c24ff9
BLAKE2b-256 checksum
How to use checksums
81121b8730ac40fe00df8d05c01041f92a218930b061291c1255fde719f8da11
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.5

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

Download URL psycopg2-2.9-cp37-cp37m-win32.whl
Size 994.3 kB
Tags CPython 3.7 CPython 3.7 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
b6f47af317af8110818d255e693cfa80b7f1e435285be09778db7b66efd95789
BLAKE2b-256 checksum
How to use checksums
6a97a1f8343aa6363cee8f39503ad705cd16ea46445bcdc4a75433fadc7f062d
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.5

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

Download URL psycopg2-2.9-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
f3d42bd42302293767b84206d9a446abc67ed4a133e4fe04dad8952de06c2091
BLAKE2b-256 checksum
How to use checksums
94022c7004959ed4ec2c40acae409b42cb1c4ff982e34356f017489ecfb1b087
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.5

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

Download URL psycopg2-2.9-cp36-cp36m-win32.whl
Size 994.4 kB
Tags CPython 3.6 CPython 3.6 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
e84c80be7a238d3c9c099b71f6890eaa35fc881146232cce888a88ab1bfb431e
BLAKE2b-256 checksum
How to use checksums
25502dc3e459b7e96d92173f49b6de52016874133794ddceeb263ab46448d344
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.5

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

2.9.2

11 release files

2.9.1

11 release files

This release

2.9 This release

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