Pulsar: macos darwin

Created on 19 Jun 2020  Â·  9Comments  Â·  Source: apache/pulsar

Describe the bug
I'm unable to import the pulsar Python library.

→ uname -a
Darwin ryoung-mbp.local 19.5.0 Darwin Kernel Version 19.5.0: Tue May 26 20:41:44 PDT 2020; root:xnu-6153.121.2~2/RELEASE_X86_64 x86_64

→ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.15.5
BuildVersion:   19F101

→ python -V
Python 3.7.7

→ pip show pulsar-client
Name: pulsar-client
Version: 2.6.0
Summary: Apache Pulsar Python client library
Home-page: https://pulsar.apache.org/
Author: Pulsar Devs
Author-email: [email protected]
License: Apache License v2.0
Location: /Users/ryoung/.pyenv/versions/3.7.7/envs/default3/lib/python3.7/site-packages
Requires: six, apache-bookkeeper-client, protobuf, ratelimit, prometheus-client, certifi, grpcio, fastavro
Required-by:

To Reproduce
Simply run python and then import pulsar.

→ python
Python 3.7.7 (default, May 20 2020, 15:06:47)
[Clang 11.0.3 (clang-1103.0.32.59)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pulsar
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/ryoung/.pyenv/versions/default3/lib/python3.7/site-packages/pulsar/__init__.py", line 102, in <module>
    import _pulsar
ImportError: dlopen(/Users/ryoung/.pyenv/versions/default3/lib/python3.7/site-packages/_pulsar.cpython-37m-darwin.so, 2): Symbol not found: __Py_tracemalloc_config
  Referenced from: /Users/ryoung/.pyenv/versions/default3/lib/python3.7/site-packages/_pulsar.cpython-37m-darwin.so
  Expected in: flat namespace
 in /Users/ryoung/.pyenv/versions/default3/lib/python3.7/site-packages/_pulsar.cpython-37m-darwin.so
>>>

Expected behavior
I expect the pulsar python client to work following the Install using pip documentation.

Desktop (please complete the following information):

  • OS: Mac 10.15.5 (19F101)
componenbuild componenpython releas2.6.2 triagweek-25 typbug

Most helpful comment

I ran into this same problem yesterday, and can confirm that upgrading from the latest Homebrew Python v3.7 to Python 3.8.3 from python.org resolved it.

https://www.python.org/ftp/python/3.8.3/python-3.8.3-macosx10.9.pkg

~~~

$ uname -a
Darwin ds-macbook-pro.local 19.5.0 Darwin Kernel Version 19.5.0: Tue May 26 20:41:44 PDT 2020; root:xnu-6153.121.2~2/RELEASE_X86_64 x86_64

$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.15.5
BuildVersion: 19F101

$ python3 -V
Python 3.8.3

$ pip show pulsar-client
Name: pulsar-client
Version: 2.6.0
Summary: Apache Pulsar Python client library
Home-page: https://pulsar.apache.org/
Author: Pulsar Devs
Author-email: [email protected]
License: Apache License v2.0
Location: /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages
Requires: fastavro, certifi, apache-bookkeeper-client, prometheus-client, protobuf, grpcio, six, ratelimit
Required-by:

$ python3
Python 3.8.3 (v3.8.3:6f8c8320e9, May 13 2020, 16:29:34)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

import pulsar

~~~

All 9 comments

It seems that because the libpulsar 2.6.0's package has not yet been released https://github.com/Homebrew/homebrew-core/pulls?q=libpulsar, @codelipenghui is releasing this package, which may take some time. Thanks @codelipenghui

It seems that because the libpulsar 2.6.0's package has not yet been released

Python client is not using libpulsar C++ client from a package. Rather, the library is bundled together in the wheel file.

 ImportError: dlopen(/Users/ryoung/.pyenv/versions/default3/lib/python3.7/site-packages/_pulsar.cpython-37m-darwin.so, 2): 
Symbol not found: __Py_tracemalloc_config

The issue seems to be related by the fact that we're using Boost-Python38 with Python3.7 : https://github.com/YosysHQ/nextpnr/issues/450

I ran into this same problem yesterday, and can confirm that upgrading from the latest Homebrew Python v3.7 to Python 3.8.3 from python.org resolved it.

https://www.python.org/ftp/python/3.8.3/python-3.8.3-macosx10.9.pkg

~~~

$ uname -a
Darwin ds-macbook-pro.local 19.5.0 Darwin Kernel Version 19.5.0: Tue May 26 20:41:44 PDT 2020; root:xnu-6153.121.2~2/RELEASE_X86_64 x86_64

$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.15.5
BuildVersion: 19F101

$ python3 -V
Python 3.8.3

$ pip show pulsar-client
Name: pulsar-client
Version: 2.6.0
Summary: Apache Pulsar Python client library
Home-page: https://pulsar.apache.org/
Author: Pulsar Devs
Author-email: [email protected]
License: Apache License v2.0
Location: /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages
Requires: fastavro, certifi, apache-bookkeeper-client, prometheus-client, protobuf, grpcio, six, ratelimit
Required-by:

$ python3
Python 3.8.3 (v3.8.3:6f8c8320e9, May 13 2020, 16:29:34)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

import pulsar

~~~

It seems to me that there's an issue in the env that is building the wheel files. We're publishing both pulsar_client-2.6.0-cp37-cp37m-macosx_10_15_x86_64.whl as well as pulsar_client-2.6.0-cp38-cp38m-macosx_10_15_x86_64.whl but both seem to be built with Boost-Python3.8.

Looks we need to fix the python release script right?

Move the issue to 2.6.2

It seems to me that there's an issue in the env that is building the wheel files. We're publishing both pulsar_client-2.6.0-cp37-cp37m-macosx_10_15_x86_64.whl as well as pulsar_client-2.6.0-cp38-cp38m-macosx_10_15_x86_64.whl but both seem to be built with Boost-Python3.8.

Yes, this is because we use the boost-python38 lib to build the python37 version. I modified a boost-python3.rb file to build the boost-python37 lib, which may solve our problem.

In 2.6.2, we have fixed this problem, if you want to use it in 2.6.1, please upgrade the python version to 3.8.3.

Will close this issue.

Was this page helpful?
0 / 5 - 0 ratings