googleapis / python-crc32c

Apache License 2.0
22 stars 25 forks source link

Solution for _SLOW_CRC32C_WARNING #131

Closed ibiscp closed 8 months ago

ibiscp commented 2 years ago

Hi, I am running a python program inside a docker container in a Raspberry Pi 4 and getting the following warning:

/usr/local/lib/python3.8/site-packages/google_crc32c/__init__.py:29: RuntimeWarning: As the c extension couldn't be imported, `google-crc32c` is using a pure python implementation that is significantly slower. If possible, please configure a c build environment and compile the extension
  warnings.warn(_SLOW_CRC32C_WARNING, RuntimeWarning)

My .dockerfile

FROM python:3.7.10

WORKDIR /app

ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends apt-utils

# Requirements for aiortc
RUN apt-get install -y libopus-dev libvpx-dev
RUN apt-get install -y libavformat-dev libavcodec-dev libavdevice-dev libavutil-dev libswscale-dev libavresample-dev libavfilter-dev
RUN apt-get install -y rustc libsrtp2-dev

# Requirements for sounddevice
RUN apt-get install -y libportaudio2

# Install requirements
COPY audio/requirements.txt .
RUN pip install --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt

The python implementation is causing delays to my app, I want to use the c implementation.

If you have any solution for this, please let me know.

parthea commented 8 months ago

See https://github.com/googleapis/python-crc32c/issues/83#issuecomment-910515271 which includes a Dockerfile to avoid using pure python for users who are on non-manylinux Linux platforms. I'm going to close this issue but please feel free to open a new issue with more information. If you're still having issues after trying https://github.com/googleapis/python-crc32c/issues/83#issuecomment-910515271 please also share the Dockerfile to help reproduce the issue.