我尝试构建以下 Dockerfile:
FROM python:3.10
ENV TZ Europa/Berlin
# install google chrome
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
RUN sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
RUN apt-get -y update
RUN apt-get install -y google-chrome-stable
# install chromedriver
RUN apt-get install -yqq unzip
RUN wget -O /tmp/chromedriver.zip http://chromedriver.storage.googleapis.com/`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE`/chromedriver_linux64.zip
RUN unzip /tmp/chromedriver.zip chromedriver -d /usr/local/bin/
# set display port to avoid crash
ENV DISPLAY=:99
# upgrade pip
RUN pip install --upgrade pip
# install selenium
RUN pip install selenium
# install mariadb
RUN apt-get install -y libmariadb-dev
RUN pip install mariadb
但我无法安装 mariadb,而是收到以下错误:
"MariaDB Connector/Python requires MariaDB Connector/C >= 3.2.4, found version 3.1.16"
我可以做什么来解决这个问题?
libmariadb-dev 的 MariaDB-10.5.15 版本对应于 libmariadb-3.1.16。
约束the pip install mariadb
to a 1.0版本 https://pypi.org/project/mariadb/1.0.11/#history.
或者使用 Debian bullseye(对应于 python 基础镜像)libmariadb-devMariaDB 公司存储库 https://mariadb.com/docs/connect/programming-languages/c/install/#connector-c-install-repo-install.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)