[CONPY-223] python setup.py egg_info did not run successfully. MariaDB Connector/Python requires MariaDB Connector/C Created: 2022-09-06  Updated: 2022-09-16  Resolved: 2022-09-06

Status: Closed
Project: MariaDB Connector/Python
Component/s: Installation
Affects Version/s: 1.1.4
Fix Version/s: N/A

Type: Bug Priority: Minor
Reporter: Taavi Ansper Assignee: Georg Richter
Resolution: Not a Bug Votes: 0
Labels: None

Python Version: 3.9 3.10

 Description   

Hi

I would like some help with a docker build.

I have created a basic installation of python using this: https://stackoverflow.com/questions/53835198/integrating-python-poetry-with-docker

```
FROM python:3.10-alpine3.16 as base

  1. input arguments
    ARG MARIADB_USER
    ARG MARIADB_PASSWORD
    ARG MARIADB_HOST
    ARG MARIADB_PORT
    ARG MARIADB_DB

WORKDIR /app

FROM base as builder

ENV PIP_DEFAULT_TIMEOUT=100 \
PIP_DISABLE_PIP_VERSION_CHECK=1 \
POETRY_VERSION=1.1.14 \
MARIADB_USER=${MARIADB_USER} \
MARIADB_PASSWORD=${MARIADB_PASSWORD} \
MARIADB_HOST=${MARIADB_HOST} \
MARIADB_PORT=${MARIADB_PORT} \
MARIADB_DB=${MARIADB_DB}

RUN apk add --no-cache gcc libffi-dev musl-dev mariadb-connector-c-dev mariadb-connector-c mariadb-client

RUN pip install --upgrade pip
RUN pip install "poetry==$POETRY_VERSION"

COPY pyproject.toml poetry.lock ./
RUN poetry install

COPY . .

FROM base as final

COPY --from=builder /venv /venv
COPY docker-entrypoint.sh wsgi.py ./
CMD ["./docker-entrypoint.sh"]

```

Now on my computer with libmariadb3 and libmariadb-dev on ubuntu 22.04 I can install mariadb, but using both python:3.10-bullseye and alpine versions of the docker container I get the error that it needs the C connector. I've tried all the solutions and i've tried installing most of the mariadb related pckgs.

EDIT: I can just do pip install mariadb and it would fail aswell the poetry thing doesn't matter



 Comments   
Comment by Taavi Ansper [ 2022-09-06 ]

Found the problem.

WORKING:

alpine3.16 doesnt have the latest and greatest.

IMAGE: python3.10-alpine3.16
POETRY: 1.1.14
pip-22.2.2 setuptools-65.3.0
mariadb: 1.0.11

mariadb-connector-c-dev -> what comes from alpine

Also:

apk add mariadb-connector-c-dev build-base

Comment by Georg Richter [ 2022-09-06 ]

Minimum required Connector/C version is 3.2.4. Buster has MariaDB Server 10.3, corresponding C/C version is 3.1.x - so instead of buster you should bookworm (Server version 10.6.8, C/C version 3.2.8)

Comment by Taavi Ansper [ 2022-09-06 ]

I used Alpine3.16.

Comment by Mihir Samdarshi [ 2022-09-16 ]

I am not sure that this should be closed, I am having the same issue using python:3.10-alpine docker image. I am using also using mariadb:latest docker image (10.9, I assume).

Generated at Thu Feb 08 03:31:10 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.