Quantcast
Channel: Active questions tagged ubuntu - Stack Overflow
Viewing all articles
Browse latest Browse all 5952

Python 3.10 cannot open shared object file librdkafka

$
0
0

I am trying to upgrade a relatively simple Python app thats reads a Kafka Topic, processes and then calls the API.

Currently it is running in a docker container based on Python 3.8 on Ubuntu 20.04 LTS. I am looking to upgrade to Python 3.10 on Ubuntu 22.04 LTS.

The docker container builds without issues but there is an issue when running the app or the tests.

ImportError while importing test module '/code/fr24/tests/test_feed.py'.Hint: make sure your test modules/packages have valid Python names.Traceback:/usr/lib/python3.10/importlib/__init__.py:126: in import_module    return _bootstrap._gcd_import(name[level:], package, level)......from confluent_kafka.cimpl import Consumer as _ConsumerImplE   ImportError: librdkafka.so.1: cannot open shared object file: No such file or directory

I added

RUN apt-get install -y librdkafka-dev

to the Ubuntu 22.04 Dockerfile. Then I got a different error

ImportError: libc.musl-x86_64.so.1: cannot open shared object file: No such file or directory

Which makes me think it's likely a path issue.

docker-compose run fr24 python -c "import sys; print('\n'.join(sys.path))"

returns

/usr/local/lib/python3.10/dist-packages/_pdbpp_path_hack/code/fr24/code/usr/lib/python310.zip/usr/lib/python3.10/usr/lib/python3.10/lib-dynload/usr/local/lib/python3.10/dist-packages/usr/lib/python3/dist-packages

docker-compose run fr24 env returns among others

PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/binPYTHONPATH=/code/fr24:

am I missing something simple here?


Viewing all articles
Browse latest Browse all 5952

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>