ERROR: Failed building wheel for psycopg2-binary
Using cached psycopg2-binary-2.9.10.tar.gz (385 kB)
Preparing metadata (setup.py) ... done
Building wheels for collected packages: psycopg2-binary
Building wheel for psycopg2-binary (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [32 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
creating build\temp.win-amd64-cpython-313\Release\psycopg
"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.42.34433\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD "-DPSYCOPG_VERSION=2.9.10 (dt dec pq3 ext lo64)" -DPSYCOPG_DEBUG=1 -DPG_VERSION_NUM=170002 -DHAVE_LO64=1 -DPSYCOPG_DEBUG=1 -IC:\Users\hello\memesite\myenv\include "-IC:\Program Files\Python313\include" "-IC:\Program Files\Python313\Include" -I. -IC:/PROGRA~1/POSTGR~1/17/include -IC:/PROGRA~1/POSTGR~1/17/include/server "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.42.34433\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include" /Tcpsycopg\adapter_asis.c /Fobuild\temp.win-amd64-cpython-313\Release\psycopg\adapter_asis.obj
adapter_asis.c
C:\Program Files\Python313\include\pyconfig.h(59): fatal error C1083: Cannot open include file: 'io.h': No such file or directory
It appears you are missing some prerequisite to build the package from source.
You may install a binary package by installing 'psycopg2-binary' from PyPI.
If you want to install psycopg2 from source, please install the packages
required for the build and try again.
For further information please check the 'doc/src/install.rst' file (also at
<https://www.psycopg.org/docs/install.html>).
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.42.34433\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
[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
Running setup.py clean for psycopg2-binary
Failed to build psycopg2-binary
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (psycopg2-binary)
ERROR: Failed building wheel for psycopg2-binary
Running setup.py clean for psycopg2-binary
Failed to build psycopg2-binary
ERROR: Failed to build installable wheels for some pyproject.toml based projects (psycopg2-binary)
psycopg2-binary doesn't currently support Python 3.13 on Windows. There are Python 3.13 wheels available for this package on Linux and MacOS but not Windows.
You should downgrade to Python 3.12 to use this package on your windows machine. If you are developing something new and not maintaining an existing program that uses psycopg2 as a dependency, you can use psycopg3 which is the successor of psycopg2 and the current implementation of a PostgreSQL adapter for Python.