Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C++ error #1751

Closed
TgEsEvo opened this issue Nov 16, 2024 · 2 comments
Closed

C++ error #1751

TgEsEvo opened this issue Nov 16, 2024 · 2 comments

Comments

@TgEsEvo
Copy link

TgEsEvo commented Nov 16, 2024

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:

Please complete the following information:

  • OS: windows 11
  • Psycopg version: 2.10
  • Python version: 3.13
  • PostgreSQL version: 16
  • pip version 24

error:

Collecting psycopg2==2.9.10
Using cached psycopg2-2.9.10.tar.gz (385 kB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Building wheels for collected packages: psycopg2
Building wheel for psycopg2 (setup.py): started
Building wheel for psycopg2 (setup.py): finished with status 'error'
Running setup.py clean for psycopg2
Failed to build psycopg2

Could not find platform independent libraries
error: subprocess-exited-with-error

python setup.py bdist_wheel did not run successfully.
exit code: 1

[33 lines of output]
Could not find platform independent libraries
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=160004 -DHAVE_LO64=1 -DPSYCOPG_DEBUG=1 -IC:\code\python\DjangoProject.venv\include -IC:\Users\Administrator\AppData\Local\Temp\pip-install-k12uenq0\psycopg2_61bfc7a72e6943f182cbe6baa5b59623\include -IC:\Users\Administrator\AppData\Local\Temp\pip-install-k12uenq0\psycopg2_61bfc7a72e6943f182cbe6baa5b59623\Include -I. -IC:/PROGRA1/POSTGR1/16/include -IC:/PROGRA1/POSTGR1/16/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" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\cppwinrt" /Tcpsycopg\adapter_asis.c /Fobuild\temp.win-amd64-cpython-313\Release\psycopg\adapter_asis.obj
adapter_asis.c
.\psycopg/psycopg.h(35): fatal error C1083: Cannot open include file: 'Python.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
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (psycopg2)

@dvarrazzo
Copy link
Member

Please read the installation instruction.

@dvarrazzo
Copy link
Member

And see #1736.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants