livekit v0.6.0 (with python3.9, ubuntu20.04) claims to be compatible with protobuf versions >=3.1.0, but import fails when installed alongside 3.19.4.
To reproduce, build the following Dockerfile and run python3.9 -c "from livekit import rtc" inside:
FROM ubuntu:20.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y python3.9-dev=3.9.5-3* python3-pip
RUN python3.9 -m pip install --upgrade pip
RUN python3.9 -m pip install ipython livekit==0.6.0 protobuf==3.19.4
output is:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/local/lib/python3.9/dist-packages/livekit/rtc/__init__.py", line 19, in <module>
from ._proto.room_pb2 import (
File "/usr/local/lib/python3.9/dist-packages/livekit/rtc/_proto/room_pb2.py", line 8, in <module>
from google.protobuf.internal import builder as _builder
ImportError: cannot import name 'builder' from 'google.protobuf.internal' (/usr/local/lib/python3.9/dist-packages/google/protobuf/internal/__init__.py)
Even after following the solution suggested here, import fails with the following output:
[2023-12-06T23:27:03Z INFO livekit_ffi::server::requests] initializing ffi server v0.3.13
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/local/lib/python3.9/dist-packages/livekit/rtc/__init__.py", line 34, in <module>
from .audio_stream import AudioStream
File "/usr/local/lib/python3.9/dist-packages/livekit/rtc/audio_stream.py", line 23, in <module>
from .track import Track
File "/usr/local/lib/python3.9/dist-packages/livekit/rtc/track.py", line 26, in <module>
class Track:
File "/usr/local/lib/python3.9/dist-packages/livekit/rtc/track.py", line 40, in Track
def kind(self) -> proto_track.TrackKind.ValueType:
File "/usr/local/lib/python3.9/dist-packages/google/protobuf/internal/enum_type_wrapper.py", line 114, in __getattr__
raise AttributeError('Enum {} has no value defined for name {!r}'.format(
AttributeError: Enum TrackKind has no value defined for name 'ValueType'
livekit v0.6.0 (with python3.9, ubuntu20.04) claims to be compatible with protobuf versions >=3.1.0, but import fails when installed alongside 3.19.4.
To reproduce, build the following Dockerfile and run
python3.9 -c "from livekit import rtc"
inside:output is:
Even after following the solution suggested here, import fails with the following output: