You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

基于Flask的Docker化Web应用构建时rdkit安装失败求助

构建Flask Docker化化学Web应用时的rdkit安装问题

问题概述

我在构建基于Flask的Docker化化学相关Web应用时遇到问题,该应用需要导入rdkit模块,同时通过Docker搭建虚拟工作节点用于建模。两天前(美国中部夏令时约23:00)开始,构建过程中安装requirements.txt阶段出现rdkit版本找不到的错误,之前从未遇到过。

环境配置

Docker Compose 文件

version: '2'
services:
    redis:
        image: redis
#        ports:
#            - "6379:6379"
        volumes:
            - ./redis:/usr/local/etc/redis
#        command: redis-server --include /usr/local/etc/redis/redis.conf

    toxpro:
        build: .
        env_file:
            - docker-environment-do.env
        ports:
            - "80:5000"
        image: toxpro:lastest
        volumes:
            - ./instance/:/home/toxpro/instance
            - ./data/:/home/toxpro/data
        entrypoint: ["./boot.sh"]
        stdin_open: true
        tty: true

    worker:
        build: .
        env_file:
            - docker-environment-do.env
        depends_on:
            - redis
            - toxpro
        entrypoint: ["./boot_worker.sh"]
        volumes:
            - ./instance/:/home/toxpro/instance
            - ./data/:/home/toxpro/data

volumes:
  instance_vol:

Dockerfile

FROM python

RUN useradd toxpro

WORKDIR /home/toxpro

COPY requirements.txt requirements.txt
RUN python -m venv venv
RUN venv/bin/pip install -r requirements.txt

RUN apt-get update && apt-get install -y netcat-traditional

COPY app app
RUN mkdir logs
RUN mkdir data
RUN mkdir instance

COPY boot.sh ./
RUN chmod +x boot.sh

COPY boot_worker.sh ./
RUN chmod +x boot_worker.sh

COPY boot_dashboard.sh ./
RUN chmod +x boot_dashboard.sh

RUN apt-get install libxrender1
ENV FLASK_APP app.py

RUN chown -R toxpro:toxpro ./
USER toxpro

EXPOSE 5000

#ENTRYPOINT ["./boot.sh"]

requirements.txt

Flask==2.2
gunicorn==20.1.0
pandas==1.5.2
pip==22.3.1
plotly==5.9.0
rdkit==2022.09.2
flask-sqlalchemy==3.0.2
flask-login==0.6.2
flask-migrate==4.0.0
Flask-Mail==0.9.1
scikit-learn==1.2.0
redis==4.4.0
rq==1.11.1
PyJWT==2.6.0
numpy==1.23.2
requests==2.30.0

错误信息

98.75 ERROR: Could not find a version that satisfies the requirement rdkit2022.09.2 (from versions: none)
98.75 ERROR: No matching distribution found for rdkit
2022.09.2

failed to solve: process "/bin/sh -c venv/bin/pip install -r requirements.txt" did not complete successfully: exit code: 1
docker-compose process finished with exit code 17

已尝试的解决方法

  • 修改rdkit版本号
  • 重装pip和rdkit
  • 重新部署整个应用环境

以上方法均未解决问题,求类似问题的解决经验或思路。

内容的提问来源于stack exchange,提问作者AnthonyTuzhu

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.09 10:55:25