Repository: psycopg/psycopg2

Issue #1692: Psycopg2 doesn't install on Python 3.13 alpha
Created: 2024-04-16T07:47:20Z
This is a bug tracker
If you have a question, such has "how do you do X with Python/PostgreSQL/psycopg2" please write to the mailing list or open a question instead.
Before opening this ticket, please confirm that:

 I am running the latest version of pip, i.e. typing pip --version you get this version.
 I have read the installation documentation and the frequently asked questions
 If install failed, I typed pg_config on the command line and I obtained an output instead of an error.

Please complete the following information:

OS: Linux (6.8.5-zen1-1-zen) on Arch Linux
Psycopg version: 2.9.9
Python version: 3.13.0a6+ (heads/main:6dc661bc9f)
PostgreSQL version: 16.2
pip version: 24.0

Duplicate issue #1732: Python 3.13 on Windows11 - "pip install psycopg2-binary" is erroring, asking me to install the C++ 14.0 compiler
Created: 2024-10-08T02:15:06Z
This is a bug tracker
If you have a question, such has "how do you do X with Python/PostgreSQL/psycopg2" please write to the mailing list or open a question instead.
Before opening this ticket, please confirm that:

 I am running the latest version of pip, i.e. typing pip --version you get this version.
 I have read the installation documentation and the frequently asked questions
 If install failed, I typed pg_config on the command line and I obtained an output instead of an error.

Please complete the following information:

OS: Windows 11
Psycopg version: I don't know - it does not install
Python version: 3.13
PostgreSQL version:  16

Problem Description
installing psycopg2-binary is supposed to not require a C++ compiler, but it tries to build it anyway.  Then asks me to install 1.6GB of Microsoft C++ compiler.
=================   Output Display From pip install psycopg2========================
python -m pip install psycopg2-binary
Collecting psycopg2-binary
Using cached psycopg2-binary-2.9.9.tar.gz (384 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: psycopg2-binary
Building wheel for psycopg2-binary (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for psycopg2-binary (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [18 lines of output]
running bdist_wheel
running build
running build_py
creating build\lib.win-amd64-cpython-313\psycopg2
copying lib\errorcodes.py -> build\lib.win-amd64-cpython-313\psycopg2
copying lib\errors.py -> build\lib.win-amd64-cpython-313\psycopg2
copying lib\extensions.py -> build\lib.win-amd64-cpython-313\psycopg2
copying lib\extras.py -> build\lib.win-amd64-cpython-313\psycopg2
copying lib\pool.py -> build\lib.win-amd64-cpython-313\psycopg2
copying lib\sql.py -> build\lib.win-amd64-cpython-313\psycopg2
copying lib\tz.py -> build\lib.win-amd64-cpython-313\psycopg2
copying lib_ipaddress.py -> build\lib.win-amd64-cpython-313\psycopg2
copying lib_json.py -> build\lib.win-amd64-cpython-313\psycopg2
copying lib_range.py -> build\lib.win-amd64-cpython-313\psycopg2
copying lib_init_.py -> build\lib.win-amd64-cpython-313\psycopg2
running build_ext
building 'psycopg2._psycopg' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for psycopg2-binary
Failed to build psycopg2-binary
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (psycopg2-binary)

Closing comment (2024-10-08T09:19:12Z): Duplicate of #1692, to be fixed by #1729.