Skip to content

Python Pulsar-Client: Import error with Python 3.10 #15477

Closed

Description

@b0mbays

Describe the bug
Hi, we're experiencing an import error when using Python 3.10 on OSX 11 and 12. We're installing the python pulsar-client-2.10.0 and having the same error on two machines:

  File "my-username/my-file", line 33, in <module>
    sys.exit(load_entry_point('my-entrypoint', 'console_scripts')())
  File "my-username/my-file", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/metadata/__init__.py", line 171, in load
    module = import_module(match.group('module'))
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "my-username/my-file", line 7, in <module>
    from my-package import runner
  File "my-username/my-file", line 5, in <module>
    from setup import Setup
  File "my-username/my-file", line 17, in <module>
    from packages.pulsar.pulsar_client import Pulsar  # noqa: F401
  File "my-username/my-file", line 8, in <module>
    from pulsar import MessageId, Timeout, ConnectError, ConsumerType
  File "/my-directory/lib/python3.10/site-packages/pulsar/__init__.py", line 103, in <module>
    import _pulsar
ImportError: dlopen(/my-directory/lib/python3.10/site-packages/_pulsar.cpython-310-darwin.so, 0x0002): symbol not found in flat namespace '__ZN5boost6python6detail13current_scopeE'

If we switch to Python 3.8 or 3.9 this issue is resolved but we would really like to use python 3.10.

Thank you

Activity

  1. added
    type/bug
    on May 6, 2022
  2. gus-maurizio commented on May 10, 2022

    @gus-maurizio

    It works with version 3.8 from brew, but fails with 3.10.

  3. b0mbays commented on May 10, 2022

    @b0mbays
    Author

    It works with version 3.8 from brew, but fails with 3.10.

    Are you seeing the same error on your machine as well?

  4. gus-maurizio commented on May 10, 2022

    @gus-maurizio

    yes, same exact error. I switched to 3.8.x (whatever brew installed) and the problems went away. My guess is that the library is somehow missing for 3.10. _pulsar.cpython-310-darwin.so
    Works in 3.9 as well. so seems the problem is limited to 3.10 version of python.

  5. gus-maurizio commented on May 10, 2022

    @gus-maurizio

    Actually the library is indeed there: /usr/local/lib/python3.10/site-packages/_pulsar.cpython-310-darwin.so but it lacks some linked modules: Symbol not found: __ZN5boost6python6detail13current_scopeE

  6. gus-maurizio commented on May 10, 2022

    @gus-maurizio

    so if the powers that be can relink it it might solve the issue.

  7. b0mbays commented on May 11, 2022

    @b0mbays
    Author

    yes, same exact error. I switched to 3.8.x (whatever brew installed) and the problems went away. My guess is that the library is somehow missing for 3.10. _pulsar.cpython-310-darwin.so Works in 3.9 as well. so seems the problem is limited to 3.10 version of python.

    Which Python 3.9 version are you using? When using Python 3.9.7 and pulsar-client 2.10.0 (or 2.9.2) i'm getting:

    segmentation fault

    Thanks!

  8. github-actions commented on Jun 11, 2022

    @github-actions

    The issue had no activity for 30 days, mark with Stale label.

  9. armangurkan commented on Aug 13, 2022

    @armangurkan

    having the same issue

  10. github-actions commented on Sep 12, 2022

    @github-actions

    The issue had no activity for 30 days, mark with Stale label.

  11. tisonkun commented on Sep 12, 2022

    @tisonkun
    Member

    I think it's because we didn't release wheel for cpython 3.10. cc @codelipenghui @BewareMyPower

  12. BewareMyPower commented on Sep 12, 2022

    @BewareMyPower
    Contributor

    @tisonkun Yes. And the Python wheels of new versions (2.10.1+, 2.11.0+) for macOS are still blocked, see #17468

  13. github-actions commented on Oct 13, 2022

    @github-actions

    The issue had no activity for 30 days, mark with Stale label.

  14. tisonkun commented on Nov 10, 2022

    @tisonkun
    Member

    Work for me with Python 3.10 and Pulsar Python Client 2.10.1.

    The development of the Python client has been permanently moved to https://github.com/apache/pulsar-client-python. If it's still relevant, please open an issue there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Staletype/bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions