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

Importing psycopg2 (installed via pip) reports: ImportError: /opt/hostedtoolcache/.../3.13.0-alpha.6/.../psycopg2/_psycopg.cpython-313-x86_64-linux-gnu.so: undefined symbol: _PyInterpreterState_Get #848

Open
2 of 5 tasks
rouilj opened this issue Apr 20, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@rouilj
Copy link

rouilj commented Apr 20, 2024

Description:
Running 3.13-alpha.6, I install psycopg2 using pip install. When my program does an import psycopg2,
I get the error:

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

Action version:

        uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Tools version:

Python: 3.13-alpha.6
psycopg2: 2.9.9
Ubuntu: 22.04 runner (latest)

This same workflow works fine on 3.6->3.12.

Repro steps:
As far as I can tell this minimal test case should reproduce it:

  • install python 3.13-alpha.6
  • use pip install psycopg2
  • python3 -c import psycopg2

I can't get a shell inside a runner to test however so...

See https://github.com/roundup-tracker/roundup/actions/runs/8767065771/job/24059915708 for a full run including the error.

Expected behavior:
I expect the import to succeed without an ImportError.

Actual behavior:
The import fails with an ImportError:

Traceback (most recent call last):
  File "/home/runner/work/roundup/roundup/setup.py", line 275, in <module>
    main()
    ~~~~^^
  File "/home/runner/work/roundup/roundup/setup.py", line 152, in main
    from roundup.init import listTemplates
  File "/home/runner/work/roundup/roundup/roundup/init.py", line 29, in <module>
    from roundup.configuration import CoreConfig
  File "/home/runner/work/roundup/roundup/roundup/configuration.py", line 358, in <module>
    class DatabaseBackend(Option):
    ...<8 lines>...
                raise OptionValueError(self, value, self.class_description)
  File "/home/runner/work/roundup/roundup/roundup/configuration.py", line 360, in DatabaseBackend
    class_description = "Available backends: %s" % ", ".join(list_backends())
                                                             ~~~~~~~~~~~~~^^
  File "/home/runner/work/roundup/roundup/roundup/backends/__init__.py", line 80, in list_backends
    if have_backend(name):
       ~~~~~~~~~~~~^^^^^^
  File "/home/runner/work/roundup/roundup/roundup/backends/__init__.py", line 49, in have_backend
    get_backend(name)
    ~~~~~~~~~~~^^^^^^
  File "/home/runner/work/roundup/roundup/roundup/backends/__init__.py", line 42, in get_backend
    module = __import__(module_name, vars, level=1)
             ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/roundup/roundup/roundup/backends/back_postgresql.py", line 21, in <module>
    import psycopg2                                                   # noqa: E402
    ^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.13.0-alpha.6/x[64](https://github.com/roundup-tracker/roundup/actions/runs/8767065771/job/24059915708#step:17:65)/lib/python3.13/site-packages/psycopg2/__init__.py", line 51, in <module>
    from psycopg2._psycopg import (                     # noqa
    ...<10 lines>...
    )
ImportError: /opt/hostedtoolcache/Python/3.13.0-alpha.6/x64/lib/python3.13/site-packages/psycopg2/_psycopg.cpython-313-x86_64-linux-gnu.so: undefined symbol: _PyInterpreterState_Get
Error: Process completed with exit code 1.

See https://github.com/roundup-tracker/roundup/actions/runs/8767065771/job/24059915708 for a full run including the error.

Thanks for any help/ideas on how to debug.

-- rouilj

@rouilj rouilj added bug Something isn't working needs triage labels Apr 20, 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

2 participants