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

Psycopg2 install/build fails when imported python 3.13beta1 - cpython-313-x86_64-linux-gnu.so: undefined symbol: _PyInterpreterState_Get #864

Closed
2 of 5 tasks
rouilj opened this issue May 12, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@rouilj
Copy link

rouilj commented May 12, 2024

Description:
In order to run psycopg2, I have to install it manually in the 3.13 tree. When I do this, it builds successfully
with 3.13beta1 (the build failed with 3.13alpha6 see #848). But when importing psycopg2 I get:

  ImportError: /opt/hostedtoolcache/Python/3.13.0-beta.1/x64/lib/python3.13/site-packages/psycopg2/_psycopg.cpython-313-x86_64-linux-gnu.so: undefined symbol: _PyInterpreterState_Get

Action version:

actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Tools version:

3.13beta1

Repro steps:

 pip install psycopg2
 python -c 'import psycopg2'

should cause the crash on import with:

ImportError: /opt/hostedtoolcache/Python/3.13.0-beta.1/x64/lib/python3.13/site-packages/psycopg2/_psycopg.cpython-313-x86_64-linux-gnu.so: undefined symbol: _PyInterpreterState_Get

Expected behavior:

No import error and the ability to use the package to connect to the running postgresql server.

Actual behavior:

Crash with import error:

ImportError: /opt/hostedtoolcache/Python/3.13.0-beta.1/x64/lib/python3.13/site-packages/psycopg2/_psycopg.cpython-313-x86_64-linux-gnu.so: undefined symbol: _PyInterpreterState_Get

You can see the run at:

https://github.com/roundup-tracker/roundup/actions/runs/9054459071/job/24874353963

for full details. The pip install psycopg2 is located under the section
"Install python db libraries" and the import crash is under the section:
"Test build roundup and install locale so lang tests work."

@rouilj rouilj added bug Something isn't working needs triage labels May 12, 2024
rouilj added a commit to roundup-tracker/roundup that referenced this issue May 12, 2024
Psycopg2 now compiles but crashes on import:

  actions/setup-python#864

so progress.
@HarithaVattikuti
Copy link
Contributor

Hello @rouilj
Thank you for creating this issue. We will investigate it and get back to you as soon as we have some feedback.

@mayeut
Copy link
Contributor

mayeut commented May 14, 2024

this is an issue with psycopg2, not setup-python: psycopg/psycopg2#1695

@rouilj
Copy link
Author

rouilj commented May 14, 2024

this is an issue with psycopg2, not setup-python: psycopg/psycopg2#1695

Thanks for the pointer to that issue. It looks like that could be the problem.

The patch for psycopg/utils.c in that issue appears to change _PyInterpreterState_Get to
PyInterpreterState_Get for 3.13. I'll close this for now as I have followed up on psycopg2's 1695.
I'll re-open if it turns out that's not the fix.

Thanks.

@rouilj rouilj closed this as completed May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants