Skip to content

Trouble loading binary libraries #519

Closed
@waldotf

Description

@waldotf

I've been trying to get my plugin working with the new 3.13-based SP releases without luck. Most dependencies work fine after upgrading to whatever pip3.13 chooses. psycopg2, which is a compiled library (i.e. Python wrappers around a .so), does not. When my plugin loads, I get:

[Source.Python]
[SP] Caught an Exception:
Traceback (most recent call last):
  File "../addons/source-python/packages/source-python/plugins/command.py", line 164, in load_plugin
    plugin = self.manager.load(plugin_name)
  File "../addons/source-python/packages/source-python/plugins/manager.py", line 209, in load
    plugin._load()
    ~~~~~~~~~~~~^^
  File "../addons/source-python/packages/source-python/plugins/instance.py", line 84, in _load
    self.module.load()
    ~~~~~~~~~~~~~~~~^^
  File "../addons/source-python/plugins/tempus_loader/tempus/tempus/addon.py", line 24, in load
    Tempus = import_module('tempus.mapmodules.jump').Tempus
             ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "../addons/source-python/plugins/tempus_loader/tempus/tempus/mapmodules/jump.py", line 9, in <module>
    from tempus.db.jump import Database
  File "../addons/source-python/plugins/tempus_loader/tempus/tempus/db/jump.py", line 11, in <module>
    import psycopg2
  File "../addons/source-python/plugins/tempus_loader/tempus/psycopg2/__init__.py", line 51, in <module>
    from psycopg2._psycopg import (                     # noqa
    ...<10 lines>...
    )

ModuleNotFoundError: No module named 'psycopg2._psycopg'

which implies to me that the embedded Python interpreter doesn't recognize the provided psycopg2/_psycopg.cpython-313-i386-linux-gnu.so as a valid/usable library. I've tried rebuilding this library in a few configurations (different OS, building psycopg2 against libpq5 vs the prebuilt psycopg2-binary) without any obvious difference in behavior. Basic inspection of the .so looks like it should be fine:

# file psycopg2/_psycopg.cpython-313-i386-linux-gnu.so
psycopg2/_psycopg.cpython-313-i386-linux-gnu.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, BuildID[sha1]=956847b7b57740ce2b621cb781b46aa88e331480, stripped

Probably not a Source.Python bug per se, but I assume there's a discrepancy between my "plugin build environment" and the build server for SP that I need to fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions