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

Add Python 3.12 support for Windows #1628

Closed
dvarrazzo opened this issue Oct 3, 2023 · 11 comments
Closed

Add Python 3.12 support for Windows #1628

dvarrazzo opened this issue Oct 3, 2023 · 11 comments
Labels
wheel Bugs related to the wheel distribution, not happening installing from source windows

Comments

@dvarrazzo
Copy link
Member

We are in the process of releasing 2.9.9 with Windows support.

Building Windows packages needs to wait for appveyor/ci#3879.

@dvarrazzo dvarrazzo added windows wheel Bugs related to the wheel distribution, not happening installing from source labels Oct 3, 2023
@jdfoxito
Copy link

jdfoxito commented Oct 3, 2023

on windows 10, it dont wors

	Collecting psycopg2

Using cached psycopg2-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
Building wheel for psycopg2 (pyproject.toml) ... error
error: subprocess-exited-with-error

× Building wheel for psycopg2 (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [20 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-cpython-312
creating build\lib.win-amd64-cpython-312\psycopg2
copying lib\errorcodes.py -> build\lib.win-amd64-cpython-312\psycopg2
copying lib\errors.py -> build\lib.win-amd64-cpython-312\psycopg2
copying lib\extensions.py -> build\lib.win-amd64-cpython-312\psycopg2
copying lib\extras.py -> build\lib.win-amd64-cpython-312\psycopg2
copying lib\pool.py -> build\lib.win-amd64-cpython-312\psycopg2
copying lib\sql.py -> build\lib.win-amd64-cpython-312\psycopg2
copying lib\tz.py -> build\lib.win-amd64-cpython-312\psycopg2
copying lib_ipaddress.py -> build\lib.win-amd64-cpython-312\psycopg2
copying lib_json.py -> build\lib.win-amd64-cpython-312\psycopg2
copying lib_range.py -> build\lib.win-amd64-cpython-312\psycopg2
copying lib_init_.py -> build\lib.win-amd64-cpython-312\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
Failed to build psycopg2

@dvarrazzo
Copy link
Member Author

Correct, for the reason stated above.

@Fran-Rg
Copy link

Fran-Rg commented Oct 4, 2023

Thanks for raising this yourself for visibility.

Just to help SEO this is related to:

    from psycopg2._psycopg import (                     # noqa
ImportError: DLL load failed while importing _psycopg: The specified module could not be found.

with python --version -> 3.12.0

@dvarrazzo do you have an expected time for release? do you work closely with appveyor/ci#3879 to know when they expect to release it?

@dvarrazzo
Copy link
Member Author

@Fran-Rg No, in the past it tooks days/weeks to release new builders. You can take this time to move to psycopg 3 instead, whose packages are built on GH.

@mhudec
Copy link

mhudec commented Oct 4, 2023

@dvarrazzo - so it is better to move to newer psycopg? Because I simply installed those "Visual Studio Build Tools" + "Desktop Development with C++" option in Visual Studio Installer and pip install psycopg2-binary (which complained earlier about missing Visual Studio C++ during build) finished successfully. Maybe I should have waited with upgrade to Python 3.12...

Example of failed installation:

$ pip install psycopg2-binary
Collecting psycopg2-binary
  Using cached psycopg2-binary-2.9.9.tar.gz (384 kB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
  Preparing metadata (pyproject.toml): started
  Preparing metadata (pyproject.toml): finished with status 'done'
Building wheels for collected packages: psycopg2-binary
  Building wheel for psycopg2-binary (pyproject.toml): started
  Building wheel for psycopg2-binary (pyproject.toml): finished with status 'error'
  error: subprocess-exited-with-error

  Building wheel for psycopg2-binary (pyproject.toml) did not run successfully.
  exit code: 1

  [20 lines of output]
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-cpython-312
  creating build\lib.win-amd64-cpython-312\psycopg2
  copying lib\errorcodes.py -> build\lib.win-amd64-cpython-312\psycopg2
  copying lib\errors.py -> build\lib.win-amd64-cpython-312\psycopg2
  copying lib\extensions.py -> build\lib.win-amd64-cpython-312\psycopg2
  copying lib\extras.py -> build\lib.win-amd64-cpython-312\psycopg2
  copying lib\pool.py -> build\lib.win-amd64-cpython-312\psycopg2
  copying lib\sql.py -> build\lib.win-amd64-cpython-312\psycopg2
  copying lib\tz.py -> build\lib.win-amd64-cpython-312\psycopg2
  copying lib\_ipaddress.py -> build\lib.win-amd64-cpython-312\psycopg2
  copying lib\_json.py -> build\lib.win-amd64-cpython-312\psycopg2
  copying lib\_range.py -> build\lib.win-amd64-cpython-312\psycopg2
  copying lib\__init__.py -> build\lib.win-amd64-cpython-312\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: Could not build wheels for psycopg2-binary, which is required to install pyproject.toml-based projects

@jdfoxito
Copy link

jdfoxito commented Oct 5, 2023 via email

nalbion added a commit to Pythagora-io/gpt-pilot that referenced this issue Oct 10, 2023
> LINK : fatal error LNK1181: cannot open input file 'libpq.lib'
Maybe related: psycopg/psycopg2#1628
@MaximUnium
Copy link

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xed in position 0: invalid continuation byte. Error on python 3.12

@CRD716
Copy link

CRD716 commented Oct 22, 2023

appveyor/ci#3879
Ubuntu is released, windows likely within the next few days.

@CRD716
Copy link

CRD716 commented Oct 28, 2023

appveyor/ci#3879 (comment)
Windows and Ubuntu images are available now

@jdfoxito
Copy link

jdfoxito commented Oct 28, 2023 via email

@dvarrazzo
Copy link
Member Author

Psycopg2 packages for Python 3.12 for Windows released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wheel Bugs related to the wheel distribution, not happening installing from source windows
Projects
None yet
Development

No branches or pull requests

6 participants