BewareMyPower commented on issue #9906:
URL: https://github.com/apache/pulsar/issues/9906#issuecomment-799049682
I tried with OpenCV 4.5 that is installed by `pip3 install opencv-python`
and Pulsar client that is built with latest master in MacOS Big Sur 11.2.
Then tried the command line with a Pulsar standalone, there's no error.
```
>>> import cv2
>>> import pulsar
>>> client = pulsar.Client(service_url='pulsar://localhost:6650')
>>> producer = client.create_producer(topic='my-topic')
2021-03-15 10:27:41.285 INFO [0x117ca8e00] ConnectionPool:85 | Created
connection for pulsar://localhost:6650
2021-03-15 10:27:41.295 INFO [0x7000043a9000] ClientConnection:372 |
[127.0.0.1:50925 -> 127.0.0.1:6650] Connected to broker
2021-03-15 10:27:41.301 INFO [0x7000043a9000] HandlerBase:54 |
[persistent://public/default/my-topic, ] Getting connection from pool
2021-03-15 10:27:41.310 INFO [0x7000043a9000] ProducerImpl:176 |
[persistent://public/default/my-topic, ] Created producer on broker
[127.0.0.1:50925 -> 127.0.0.1:6650]
>>> producer.send('hello'.encode())
<_pulsar.MessageId object at 0x117b28190>
>>> img = cv2.imread('./images/lena.png')
>>> _, image_np_array = cv2.imencode('.jpg', img)
>>> print(image_np_array)
[[255]
[216]
[255]
...
[207]
[255]
[217]]
```
The segmentation fault might be something with the dependencies conflicts
with Pulsar and OpenCV. But it's hard to debug. I suggest that you can simplify
your code and watch the result again. BTW, you can also try to print the
backtrace, see
https://stackoverflow.com/questions/16731115/how-to-debug-a-python-segmentation-fault
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]