Loading [MathJax]/jax/output/CommonHTML/config.js
首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
社区首页 >问答首页 >我的码头形象一直未能安装matplotlib

我的码头形象一直未能安装matplotlib
EN

Stack Overflow用户
提问于 2022-01-30 22:38:36
回答 2查看 2.5K关注 0票数 1

我正在构建一个码头形象来运行一个烧瓶应用程序,它被命名为dp-偏移上下文。这个烧瓶应用程序使用matplotlib。我一直无法完全安装matlplotlib,尽管包含了所有必要的依赖项(我认为)。代码在时间戳791.9上似乎是错误的,原因是bdist_wheel。我不知道为什么bdist_wheel会出错,因为我在安装matplotlib之前安装了轮子。下面显示的是终端错误、我的requirements.txt文件和我的Dockerfile。

任何帮助都将不胜感激!

码头文件

代码语言:javascript
运行
AI代码解释
复制
FROM python:3.7.4-alpine

#Dependancies for matplotlib, pandas, and numpy
RUN apk add --no-cache --update \
    python3 python3-dev gcc \
    gfortran musl-dev g++ \
    libffi-dev openssl-dev \
    libxml2 libxml2-dev \
    libxslt libxslt-dev \
    jpeg-dev libjpeg make \
    libjpeg-turbo-dev zlib-dev

RUN pip install --upgrade cython
RUN pip install --upgrade pip
RUN pip install --upgrade setuptools

WORKDIR /dp-offsets

ADD . /dp-offsets

RUN pip install -r requirements.txt

CMD ["python", "app_main.py"]

Requirements.txt.文件

代码语言:javascript
运行
AI代码解释
复制
wheel==0.37.0
flask==2.0.1
flask_bootstrap
form
numpy==1.21.2
matplotlib==3.4.3
pandas==1.3.2
flask_wtf==0.15.1
wtforms==2.3.3

错误接收到

代码语言:javascript
运行
AI代码解释
复制
 > [8/8] RUN pip install -r requirements.txt:
#13 1.125 Collecting wheel==0.37.0
#13 1.713   Downloading wheel-0.37.0-py2.py3-none-any.whl (35 kB)
#13 1.874 Collecting flask==2.0.1
#13 1.975   Downloading Flask-2.0.1-py3-none-any.whl (94 kB)
#13 2.171      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 94.8/94.8 KB 444.0 kB/s eta 0:00:00
#13 2.348 Collecting flask_bootstrap
#13 2.458   Downloading Flask-Bootstrap-3.3.7.1.tar.gz (456 kB)
#13 3.130      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 456.4/456.4 KB 684.5 kB/s eta 0:00:00
#13 3.164   Preparing metadata (setup.py): started
#13 3.417   Preparing metadata (setup.py): finished with status 'done'
#13 3.585 Collecting form
#13 3.684   Downloading form-0.0.1.tar.gz (1.4 kB)
#13 3.699   Preparing metadata (setup.py): started
#13 3.929   Preparing metadata (setup.py): finished with status 'done'
#13 4.556 Collecting numpy==1.21.2
#13 4.641   Downloading numpy-1.21.2.zip (10.3 MB)
#13 15.18      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 10.3/10.3 MB 974.4 kB/s eta 0:00:00
#13 15.79   Installing build dependencies: started
#13 22.28   Installing build dependencies: finished with status 'done'
#13 22.28   Getting requirements to build wheel: started
#13 22.69   Getting requirements to build wheel: finished with status 'done'
#13 22.69   Preparing metadata (pyproject.toml): started
#13 23.05   Preparing metadata (pyproject.toml): finished with status 'done'
#13 23.34 Collecting matplotlib==3.4.3
#13 23.43   Downloading matplotlib-3.4.3.tar.gz (37.9 MB)
#13 53.17      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 37.9/37.9 MB 1.3 MB/s eta 0:00:00
#13 55.07   Preparing metadata (setup.py): started
#13 298.3   Preparing metadata (setup.py): still running...
#13 298.8   Preparing metadata (setup.py): finished with status 'done'
#13 299.1 Collecting pandas==1.3.2
#13 299.2   Downloading pandas-1.3.2.tar.gz (4.7 MB)
#13 302.7      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.7/4.7 MB 1.4 MB/s eta 0:00:00
#13 303.5   Installing build dependencies: started
#13 383.9   Installing build dependencies: still running...
#13 446.6   Installing build dependencies: still running...
#13 461.3   Installing build dependencies: finished with status 'done'
#13 461.4   Getting requirements to build wheel: started
#13 524.1   Getting requirements to build wheel: still running...
#13 524.5   Getting requirements to build wheel: finished with status 'done'
#13 524.5   Preparing metadata (pyproject.toml): started
#13 525.2   Preparing metadata (pyproject.toml): finished with status 'done'
#13 525.3 Collecting flask_wtf==0.15.1
#13 525.4   Downloading Flask_WTF-0.15.1-py2.py3-none-any.whl (13 kB)
#13 525.5 Collecting wtforms==2.3.3
#13 525.6   Downloading WTForms-2.3.3-py2.py3-none-any.whl (169 kB)
#13 525.7      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 169.1/169.1 KB 2.0 MB/s eta 0:00:00
#13 525.9 Collecting Werkzeug>=2.0
#13 526.1   Downloading Werkzeug-2.0.2-py3-none-any.whl (288 kB)
#13 526.3      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 288.9/288.9 KB 1.1 MB/s eta 0:00:00
#13 526.5 Collecting Jinja2>=3.0
#13 526.6   Downloading Jinja2-3.0.3-py3-none-any.whl (133 kB)
#13 526.7      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 133.6/133.6 KB 1.5 MB/s eta 0:00:00
#13 526.9 Collecting itsdangerous>=2.0
#13 527.0   Downloading itsdangerous-2.0.1-py3-none-any.whl (18 kB)
#13 527.2 Collecting click>=7.1.2
#13 527.3   Downloading click-8.0.3-py3-none-any.whl (97 kB)
#13 527.3      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 97.5/97.5 KB 1.8 MB/s eta 0:00:00
#13 527.5 Collecting cycler>=0.10
#13 527.6   Downloading cycler-0.11.0-py3-none-any.whl (6.4 kB)
#13 527.7 Collecting kiwisolver>=1.0.1
#13 527.9   Downloading kiwisolver-1.3.2.tar.gz (54 kB)
#13 527.9      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 54.6/54.6 KB 3.0 MB/s eta 0:00:00
#13 527.9   Preparing metadata (setup.py): started
#13 530.1   Preparing metadata (setup.py): finished with status 'done'
#13 530.7 Collecting pillow>=6.2.0
#13 530.8   Downloading Pillow-9.0.0.tar.gz (49.5 MB)
#13 569.3      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 49.5/49.5 MB 1.2 MB/s eta 0:00:00
#13 570.4   Preparing metadata (setup.py): started
#13 570.7   Preparing metadata (setup.py): finished with status 'done'
#13 570.8 Collecting pyparsing>=2.2.1
#13 571.0   Downloading pyparsing-3.0.7-py3-none-any.whl (98 kB)
#13 571.1      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 98.0/98.0 KB 825.7 kB/s eta 0:00:00
#13 571.2 Collecting python-dateutil>=2.7
#13 571.3   Downloading python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
#13 571.6      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 247.7/247.7 KB 887.6 kB/s eta 0:00:00
#13 571.8 Collecting pytz>=2017.3
#13 572.0   Downloading pytz-2021.3-py2.py3-none-any.whl (503 kB)
#13 572.5      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 503.5/503.5 KB 944.0 kB/s eta 0:00:00
#13 572.7 Collecting MarkupSafe
#13 572.8   Downloading MarkupSafe-2.0.1-cp37-cp37m-musllinux_1_1_x86_64.whl (30 kB)
#13 573.1 Collecting dominate
#13 573.2   Downloading dominate-2.6.0-py2.py3-none-any.whl (29 kB)
#13 573.5 Collecting visitor
#13 573.6   Downloading visitor-0.1.3.tar.gz (3.3 kB)
#13 573.6   Preparing metadata (setup.py): started
#13 573.8   Preparing metadata (setup.py): finished with status 'done'
#13 574.0 Collecting importlib-metadata
#13 574.1   Downloading importlib_metadata-4.10.1-py3-none-any.whl (17 kB)
#13 574.2 Collecting six>=1.5
#13 574.3   Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
#13 574.5 Collecting typing-extensions>=3.6.4
#13 574.8   Downloading typing_extensions-4.0.1-py3-none-any.whl (22 kB)
#13 575.1 Collecting zipp>=0.5
#13 575.6   Downloading zipp-3.7.0-py3-none-any.whl (5.3 kB)
#13 575.6 Building wheels for collected packages: numpy, matplotlib, pandas, flask_bootstrap, form, kiwisolver, pillow, visitor
#13 575.6   Building wheel for numpy (pyproject.toml): started
#13 657.8   Building wheel for numpy (pyproject.toml): still running...
#13 720.6   Building wheel for numpy (pyproject.toml): still running...
#13 777.1   Building wheel for numpy (pyproject.toml): finished with status 'done'
#13 777.1   Created wheel for numpy: filename=numpy-1.21.2-cp37-cp37m-linux_x86_64.whl size=21275305 sha256=82ac227d9585fb707983648e7ab6b8ff47b953a1d5d687409339ad505a8467b4
#13 777.1   Stored in directory: /root/.cache/pip/wheels/6b/8c/55/e7f441ea696acba3eba6931857214e3b33dcfe1e971b663032
#13 777.1   Building wheel for matplotlib (setup.py): started
#13 791.9   Building wheel for matplotlib (setup.py): finished with status 'error'
#13 791.9   error: subprocess-exited-with-error
#13 791.9
#13 791.9   × python setup.py bdist_wheel did not run successfully.
#13 791.9   │ exit code: 1
#13 791.9   ╰─> [861 lines of output]
#13 791.9
#13 791.9       Edit setup.cfg to change the build options; suppress output with --quiet.
#13 791.9
#13 791.9       BUILDING MATPLOTLIB
#13 791.9         matplotlib: yes [3.4.3]
#13 791.9             python: yes [3.7.4 (default, Aug 21 2019, 00:19:59)  [GCC 8.3.0]]
#13 791.9           platform: yes [linux]
#13 791.9              tests: no  [skipping due to configuration]
#13 791.9             macosx: no  [Mac OS-X only]

错误会持续一段时间。下面是最终输出

代码语言:javascript
运行
AI代码解释
复制
#13 1427.6       UPDATING build/lib.linux-x86_64-3.7/matplotlib/_version.py
#13 1427.6       set build/lib.linux-x86_64-3.7/matplotlib/_version.py to '3.4.3'
#13 1427.6       running build_ext
#13 1427.6       gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -DTHREAD_STACK_SIZE=0x100000 -fPIC -I/usr/local/include/python3.7m -c /tmp/tmpzzp8tz7k.cpp -o tmp/t
mpzzp8tz7k.o -fvisibility=hidden
#13 1427.6       gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -DTHREAD_STACK_SIZE=0x100000 -fPIC -I/usr/local/include/python3.7m -c /tmp/tmpqr5gbp_k.cpp -o tmp/t
mpqr5gbp_k.o -fvisibility-inlines-hidden
#13 1427.6       gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -DTHREAD_STACK_SIZE=0x100000 -fPIC -I/usr/local/include/python3.7m -c /tmp/tmptx14kry1.cpp -o tmp/t
mptx14kry1.o -flto
#13 1427.6       error: Failed to download any of the following: ['http://www.qhull.org/download/qhull-2020-src-8.0.2.tgz'].  Please download one of these urls and extract it into 'bui
ld/' at the top-level of the source repository.
#13 1427.6       [end of output]
#13 1427.6
#13 1427.6   note: This error originates from a subprocess, and is likely not a problem with pip.
#13 1427.7 error: legacy-install-failure
#13 1427.7
#13 1427.7 × Encountered error while trying to install package.
#13 1427.7 ╰─> matplotlib
#13 1427.7
#13 1427.7 note: This is an issue with the package mentioned above, not pip.
#13 1427.7 hint: See above for output from the failure.
------
executor failed running [/bin/sh -c pip install -r requirements.txt]: exit code: 1
EN

回答 2

Stack Overflow用户

发布于 2022-05-22 14:10:11

对于任何遇到此错误的人,以及稍后发现此帖子的人。

我无法在我的Docker容器中使用Matplotlib来解决这个问题。相反,我放弃了Matplotlib,使用了Ploly5.8.0。

票数 0
EN

Stack Overflow用户

发布于 2022-09-20 13:46:54

在Docker中运行matplotlib有多个依赖项。

我将分享一个最低限度的工作示例Dockerfile,并解释以下步骤。

代码语言:javascript
运行
AI代码解释
复制
FROM ubuntu:20.04

# setup env
RUN apt update -y
RUN apt install -y software-properties-common

# install Python3+ and pip
RUN add-apt-repository universe
RUN apt install -y python3.9 python3-pip

# install matplotlib
RUN apt install -y libjpeg-dev zlib1g-dev
RUN pip3 install --upgrade pip setuptools wheel
RUN pip3 install matplotlib

第一部分是设置Ubuntu环境,而不是专门设置matplotlib。

第二个块是配置Python环境。可能有必要覆盖容器内的默认Python版本(例如,在较早的Ubuntu版本上)。为此,可以在第二个块之后添加以下命令:

代码语言:javascript
运行
AI代码解释
复制
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 1
RUN update-alternatives --set python3 /usr/bin/python3.9

最后一节用于安装matplotlib。安装libjpeg和升级构建工具是为了确保还可以安装各种依赖项。最初的问题Dockerfile似乎遗漏了升级轮的步骤,而错误消息也意味着同样的情况。之后,matplotlib安装应该成功完成。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70922066

复制
相关文章
MyBatis Plus 常用 API 全套教程,看完没有不懂的
注意:-- 真实开发中往往都会有这四个字段,version(乐观锁)、deleted(逻辑删除)、gmt_create(创建时间)、gmt_modified(修改时间)
芋道源码
2021/01/08
1.1K0
MyBatis Plus 常用 API 全套教程,看完没有不懂的
进阶!MyBatis-Plus(基于 Springboot 演示)
这一篇从一个入门的基本体验介绍,再到对于 CRUD 的一个详细介绍,在介绍过程中将涉及到的一些问题,例如逐渐策略,自动填充,乐观锁等内容说了一下,只选了一些重要的内容,还有一些没提及到,具体可以参考官网,简单的看完,其实会发现,如果遇到单表的 CRUD ,直接用 MP 肯定舒服,如果写多表,还是用 Mybatis 多点,毕竟直接写 SQL 会直观一点,MP 给我的感觉,就是方法封装了很多,还有一些算比较是用的插件,但是可读性会稍微差一点,不过个人有个人的看法哇
BWH_Steven
2020/10/10
6560
Mybatis-plus常用API全套教程,看完没有不懂的
注意:-- 真实开发中往往都会有这四个字段,version(乐观锁)、deleted(逻辑删除)、gmt_create(创建时间)、gmt_modified(修改时间)
业余草
2020/12/29
4600
Mybatis-plus常用API全套教程,看完没有不懂的
注意:-- 真实开发中往往都会有这四个字段,version(乐观锁)、deleted(逻辑删除)、gmt_create(创建时间)、gmt_modified(修改时间)
java进阶架构师
2021/01/20
4200
Mybatis-plus常用API全套教程,看完没有不懂的
Mybatis-plus常用API全套教程,看完没有不懂的
注意:-- 真实开发中往往都会有这四个字段,version(乐观锁)、deleted(逻辑删除)、gmt_create(创建时间)、gmt_modified(修改时间)
Java识堂
2021/09/27
3521
Mybatis-plus常用API全套教程,看完没有不懂的
注意:-- 真实开发中往往都会有这四个字段,version(乐观锁)、deleted(逻辑删除)、gmt_create(创建时间)、gmt_modified(修改时间)整理了一份272页MybatisPDF文档
程序员白楠楠
2021/01/19
7220
SpringBoot中的自动代码生成 - 基于Mybatis-Plus
大家好啊,我是汤圆,今天给大家带来的是《SpringBoot中的自动代码生成 - 基于Mybatis-Plus》,希望对大家有帮助,谢谢
汤圆学Java
2021/04/22
1.1K0
基于docker可使用的api
https://github.com/spotify/docker-client
cn華少
2018/09/11
8100
Envoy 基于 API 的动态配置
当在 Envoy 配置中定义了上游集群后,Envoy 需要知道如何解析集群成员,这就是服务发现。端点发现服务(EDS)是 Envoy 基于 gRPC 或者用来获取集群成员的 REST-JSON API 服务的 xDS 管理服务。在本节我们将学习如何使用 REST-JSOn API 来配置端点的自动发现。
我是阳明
2020/06/30
3.2K1
基于GAN的自动驾驶汽车语义分割
语义分割是计算机视觉中的关键概念之一,语义分割允许计算机通过按类型对图像中的对象进行颜色编码。GAN建立在基于真实内容的基础上复制和生成原始内容的概念上,这使它们适合于在街景图像上进行语义分割的任务,不同部分的分割使在环境中导航的代理能够适当地发挥作用。
小白学视觉
2021/03/30
1K0
基于GAN的自动驾驶汽车语义分割
基于curl 的zabbix API调用
1,认证并取得加密字段 curl -i -X POST -H 'Content-Type: application/json' -d '{"jsonrpc": "2.0","method":"user
小小科
2018/05/04
3.1K0
基于curl 的zabbix API调用
基于TRIZ突破汽车芯片技术瓶颈
随着智能化和自动化的发展,汽车行业对于芯片技术越来越依赖。然而,汽车芯片技术发展遇到了瓶颈,如何突破这一瓶颈,成为了业内热议的话题。
用户9972271
2023/05/18
2800
基于 SpringBoot + Vue3.2 + Element Plus 的后台管理系统
TANSCI 基于 SpringBoot + Vue3.2 + Element Plus 的后台管理系统。
默存
2022/06/24
1.5K0
基于 SpringBoot + Vue3.2 + Element Plus 的后台管理系统
点击加载更多

相似问题

UIButton返回时丢失文本标签

21

xamarin表单中的StackLauout标签文本对齐

12

用标签xamarin表格对文本进行对齐

22

对齐页的标签和文本框

44

Xamarin窗体-打开标签时打开的多页

40
添加站长 进交流群

领取专属 10元无门槛券

AI混元助手 在线答疑

扫码加入开发者社群
关注 腾讯云开发者公众号

洞察 腾讯核心技术

剖析业界实践案例

扫码关注腾讯云开发者公众号
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档
查看详情【社区公告】 技术创作特训营有奖征文