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

pyodbc 5.1.0 vs. Python: 3.13: Installation Fails #1382

Closed
sentient6 opened this issue Oct 8, 2024 · 7 comments
Closed

pyodbc 5.1.0 vs. Python: 3.13: Installation Fails #1382

sentient6 opened this issue Oct 8, 2024 · 7 comments

Comments

@sentient6
Copy link

Environment

  • OS: Debian GNU/Linux 12 (bookworm)
  • Python: 3.13
  • pip: 24.2
  • pyodbc: 5.1.0
  • psycopg2: 2.9.9

Issue

Expected behavior: installation via pip succeeds.

Observed behavior: installation via pip fails.

Output:

Building wheels for collected packages: psycopg2, pyodbc
  Building wheel for psycopg2 (pyproject.toml): started
  Building wheel for psycopg2 (pyproject.toml): finished with status 'done'
  Created wheel for psycopg2: filename=psycopg2-2.9.9-cp313-cp313-linux_x86_64.whl size=520844 sha256=5bcc42cf01ad04e88b725e67c487e7fdaa13013cea42fac1a49d048c6043e007
  Stored in directory: /tmp/pip-ephem-wheel-cache-apwfaodp/wheels/2a/2a/86/08f4d537c1f8ebeeb82497d4a665e0eea2934e03b5aed4518c
  Building wheel for pyodbc (pyproject.toml): started
  Building wheel for pyodbc (pyproject.toml): finished with status 'error'
  error: subprocess-exited-with-error

  × Building wheel for pyodbc (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [34 lines of output]
      WARNING: '' not a valid package name; please use only .-separated package names in setup.py
      running bdist_wheel
      running build
      running build_py
      creating build/lib.linux-x86_64-cpython-313
      copying src/pyodbc.pyi -> build/lib.linux-x86_64-cpython-313
      running build_ext
      building 'pyodbc' extension
      creating build/temp.linux-x86_64-cpython-313/src
      g++ -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O3 -Wall -fPIC -DPYODBC_VERSION=5.1.0 -I/usr/local/include/python3.13 -c src/cnxninfo.cpp -o build/temp.linux-x86_64-cpython-313/src/cnxninfo.o -Wno-write-strings
      g++ -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O3 -Wall -fPIC -DPYODBC_VERSION=5.1.0 -I/usr/local/include/python3.13 -c src/connection.cpp -o build/temp.linux-x86_64-cpython-313/src/connection.o -Wno-write-strings
      g++ -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O3 -Wall -fPIC -DPYODBC_VERSION=5.1.0 -I/usr/local/include/python3.13 -c src/cursor.cpp -o build/temp.linux-x86_64-cpython-313/src/cursor.o -Wno-write-strings
      g++ -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O3 -Wall -fPIC -DPYODBC_VERSION=5.1.0 -I/usr/local/include/python3.13 -c src/decimal.cpp -o build/temp.linux-x86_64-cpython-313/src/decimal.o -Wno-write-strings
      g++ -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O3 -Wall -fPIC -DPYODBC_VERSION=5.1.0 -I/usr/local/include/python3.13 -c src/errors.cpp -o build/temp.linux-x86_64-cpython-313/src/errors.o -Wno-write-strings
      g++ -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O3 -Wall -fPIC -DPYODBC_VERSION=5.1.0 -I/usr/local/include/python3.13 -c src/getdata.cpp -o build/temp.linux-x86_64-cpython-313/src/getdata.o -Wno-write-strings
      g++ -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O3 -Wall -fPIC -DPYODBC_VERSION=5.1.0 -I/usr/local/include/python3.13 -c src/params.cpp -o build/temp.linux-x86_64-cpython-313/src/params.o -Wno-write-strings
      src/params.cpp: In function ‘int PyToCType(Cursor*, unsigned char**, PyObject*, ParamInfo*)’:
      src/params.cpp:250:36: error: too few arguments to function ‘int _PyLong_AsByteArray(PyLongObject*, unsigned char*, size_t, int, int, int)’
        250 |             if (_PyLong_AsByteArray((PyLongObject*)absVal, pNum->val, sizeof(pNum->val), 1, 0))
            |                 ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      In file included from /usr/local/include/python3.13/longobject.h:107,
                       from /usr/local/include/python3.13/Python.h:81,
                       from src/pyodbc.h:40,
                       from src/params.cpp:15:
      /usr/local/include/python3.13/cpython/longobject.h:111:17: note: declared here
        111 | PyAPI_FUNC(int) _PyLong_AsByteArray(PyLongObject* v,
            |                 ^~~~~~~~~~~~~~~~~~~
      src/params.cpp:480:38: error: too few arguments to function ‘int _PyLong_AsByteArray(PyLongObject*, unsigned char*, size_t, int, int, int)’
        480 |         int ret = _PyLong_AsByteArray((PyLongObject*)digitLong, pNum->val, sizeof(pNum->val), 1, 0);
            |                   ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      /usr/local/include/python3.13/cpython/longobject.h:111:17: note: declared here
        111 | PyAPI_FUNC(int) _PyLong_AsByteArray(PyLongObject* v,
            |                 ^~~~~~~~~~~~~~~~~~~
      error: command '/usr/bin/g++' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pyodbc
Successfully built psycopg2
Failed to build pyodbc
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (pyodbc)

Probably addressed w/ #1361 (#1344) but not released yet?

@marco-carvalho
Copy link

A release to address 3.13 would be most appreciated 😁

@gordthompson
Copy link
Collaborator

For now, try

pip install git+https://github.com/mkleehammer/pyodbc.git

@keitherskine
Copy link
Collaborator

@mkleehammer In the "build artifacts" pipeline, cibuildwheel has been updated to v2.21.3, which uses the new Python 13.3.0 release. Tests pass on all Python versions from 3.8 to 3.13. I believe pyodbc for Python 13.3 can be released now.

@urjeetpatel
Copy link

It seems like pypi will not accept the 3.13 build without a version bump. Looks like the last uploaded artifact is from Feb 5.

Can i please request a minor version bump?

@bdr-sara
Copy link

Hi, I’m using Python 3.13.0 and noticed that pre-built wheels for pyodbc are not yet available for this version. I tried building from source but encountered errors. I wanted to check if support for Python 3.13 is planned or if there’s any update on when it might be available. Is there a timeline for this?

Thank you for your hard work on maintaining this project!

@mkleehammer
Copy link
Owner

Version 5.2.0 has been released with wheels for Python 3.13, thanks to @keitherskine

@sentient6
Copy link
Author

Version 5.2.0 has been released with wheels for Python 3.13, thanks to @keitherskine

Thank you, @keitherskine and @mkleehammer - keep up the good work!

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

7 participants