Open ilsaloving opened 1 month ago
The error you're encountering is due to the absence of pkg-config
in your Docker image. To resolve this, you need to install pkg-config
before attempting to install mysqlclient
. You can modify your Dockerfile as follows:
FROM apache/superset:4.1.0rc2
USER root
RUN apt-get update && apt-get install -y \
pkg-config \
default-libmysqlclient-dev \
curl links zip unzip basez && \
apt-get purge -y --auto-remove
RUN pip install --upgrade pip --root-user-action && \
pip install --root-user-action \
shillelagh[gsheetsapi] \
gunicorn[gevent] \
pymssql \
elasticsearch-dbapi \
elasticsearch-dbapi[opendistro] \
mysqlclient \
psycopg2 \
trino \
trino[sqlalchemy] \
playwright \
python-ldap \
pip-system-certs
# Custom init
COPY superset_config.py superset-init.sh /app/
USER superset
This should resolve the pkg-config: not found
error and allow you to install mysqlclient
successfully.
To continue talking to Dosu, mention @dosu.
I was able to solve it by installing pkg-config, but now I'm getting complaints about missing gcc. I thought this was a different issue from #29727 but apparently it's the same thing.
I'm wondering if there needs to be an easier mechanism or guidance for people to install needed database drivers. I can see this being a problem for less experienced people.
Since the base image is running off Debian 12, I was able to make the following adjustments to my Dockerfile so everything would work without requiring a full compilation environment. I'm still fiddling with it, but this gets past the build errors.
Note: I also had to install the distro packages for ldap
and psycopg2
as well, and then install psycopg2-binary
via pip or superset wouldn't find it.
FROM apache/superset:4.1.0rc2
USER root
RUN <<EOF
apt-get update
apt-get upgrade -y
apt-get install -y curl links zip unzip basez python3-mysqldb python3-ldap python3-psycopg2 python3-psycopg2cffi
apt-get purge -y --auto-remove
EOF
COPY superset_config.py superset-init.sh /app/
RUN <<EOF
pip --root-user-action install --upgrade pip
pip install \
psycopg2-binary \
shillelagh[gsheetsapi] \
gunicorn[gevent] \
pymssql \
elasticsearch-dbapi \
elasticsearch-dbapi[opendistro] \
trino \
trino[sqlalchemy] \
playwright \
pip-system-certs \
Pillow \
EOF
USER superset
Final update... I will create a separate ticket for this but the distro-provided python3-ldap does not work, because it is installed for python 3.11, but superset uses 3.10. While I could alter the system to point to 3.11 instead, I'm hesitant to do that since it's not a supported configuration.
Sounds like we're all set to close this then? Let me know if you think there's anything left to tackle. If you want to add any docs, that'd be encouraged. Indeed we don't yet support 3.11, but we will in time, no doubt.
I guess, but only because this is a symptom of a bigger problem.
Bug description
I am trying to create a new docker container using 4.1.0rc2 as a base, and when I try to install the mysql client, I get
pkg-config: not found
. Stack trace is in Additional Content. Below is my docker file. Not sure if this should be pre-packaged with the superset container, or up to the user to install when extending the image?Screenshots/recordings
No response
Superset version
master / latest-dev
Python version
3.10
Node version
Not applicable
Browser
Not applicable
Additional context
Checklist