python - pip 使用 alpine 映像在 docker 中安装 pandas
问题描述
FROM python:3.9-alpine
RUN pip3 install pandas
RUN pip3 install -U scikit-learn
RUN pip install sqlalchemy
RUN pip install PyMySQL
COPY Movie_Recommendation.py /Movie_Recommendation.py
RUN cat /Movie_Recommendation.py
RUN echo "* * * * * echo hello" | crontab -
RUN echo "* * * * * python3 /Movie_Recommendation.py" | crontab -
CMD ["crond","-f"]
您好,我正在使用此 dockerfile 使用 cron 运行此文件当我使用另一个图像然后 alpine 它可以运行 python 文件但我不能执行 cron 所以,我正在使用 alpine 但如果我执行 RUN pip3 install pandas 或运行 pip3 安装 -U scikit-learn
当文件运行时,如果我在没有熊猫的情况下运行 dockerfile,它会为熊猫安装出错,它会要求我安装它
错误:
#5 88.03 ERROR: Command errored out with exit status 1: /usr/local/bin/python /usr/local/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /tmp/tmpck96wudq Check the logs for full command output.
#5 88.03 ----------------------------------------
#5 88.03 ERROR: Command errored out with exit status 1: /usr/local/bin/python /usr/local/lib/python3.9/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-mfrnv78r/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel 'Cython>=0.29.21,<3' 'numpy==1.15.4; python_version=='"'"'3.6'"'"' and platform_system!='"'"'AIX'"'"'' 'numpy==1.15.4; python_version=='"'"'3.7'"'"' and platform_system!='"'"'AIX'"'"'' 'numpy==1.17.3; python_version=='"'"'3.8'"'"' and platform_system!='"'"'AIX'"'"'' 'numpy==1.16.0; python_version=='"'"'3.6'"'"' and platform_system=='"'"'AIX'"'"'' 'numpy==1.16.0; python_version=='"'"'3.7'"'"' and platform_system=='"'"'AIX'"'"'' 'numpy==1.17.3; python_version=='"'"'3.8'"'"' and platform_system=='"'"'AIX'"'"'' 'numpy; python_version>='"'"'3.9'"'"'' Check the logs for full command output.
------
failed to solve with frontend dockerfile.v0: failed to build LLB: executor failed running [/bin/sh -c pip3 install pandas]: runc did not terminate sucessfully
任何帮助将不胜感激!谢谢!
解决方案:使用此泊坞窗图像: https ://hub.docker.com/r/frolvlad/alpine-python-machinelearning
解决方案
推荐阅读
- docker - 为什么我可以绑定到 80 端口
- c# - 在这种情况下,我如何在 Unity 中向上缩放对象
- git - git push 出错 [致命:远程端意外挂断]
- javascript - 如何从 sessionStorage 中检索多个选择值并将它们放入原始表单字段中
- java - 如何使用 java spring boot 应用程序中的 SQL CONTAINS 查询 Cosmos DB 图?
- elasticsearch - 如果出现则必须与关键字匹配文档,如果关键字不出现则必须匹配其他文档
- python - 预定消息删除后仍在发送
- java - java.lang.NoClassDefFoundError:来自 Keycloak 的 java/security/acl/Group
- javascript - 允许用户将项目添加到上下文菜单 - chrome 扩展
- javascript - 从 Node.js Telegram Bot 中的另一个文件打印输出