docker lxmlインストールエラー

よろしくお願いします。

スクレイピングの勉強をするため、dockerで環境構築をしようと思いましたが、lxmlのインストールエラーでうまく先に進めません。

  • エラーメッセージ

src/lxml/etree.c:269578:53: error: ‘PyLongObject’ {aka ‘struct _longobject’} has no member named ‘ob_digit’
複数行出ます。

  • docker file
FROM python:3.12.0a5-bullseye WORKDIR /usr/src/app RUN apt-get update && apt-get install -y unzip RUN apt-get -y upgrade gcc RUN apt-get install build-essential RUN dpkg --add-architecture amd64 RUN dpkg --print-foreign-architectures RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add RUN echo 'deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main' | tee /etc/apt/sources.list.d/google-chrome.list RUN apt-get update RUN apt-get install -y google-chrome-stable ADD https://chromedriver.storage.googleapis.com/110.0.5481.77/chromedriver_linux64.zip /opt/chrome/ RUN cd /opt/chrome/ && \ unzip chromedriver_linux64.zip ENV PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/chrome COPY requirements.txt ./ RUN pip install --upgrade pip && pip install --no-cache-dir -r ./requirements.txt``` https://hossuii.com/?p=1282の方のコードを利用させていただきましたが、chormeがうまく入らなかったため、 ```RUN dpkg --add-architecture amd64 RUN dpkg --print-foreign-architectures``` を追加しました。 色々試してみましたが、お手上げです。ご教示いただけると助かります。よろしくお願いいたします。

コメントを投稿

0 コメント