Python|--pip|--报错:ERROR: Cannot uninstall numpy 1.26.4, RECORD file not found. Hint: The package was installed by debian.

前言

一个Python项目, 需要部署到docker容器中, 此时正在执行构建镜像的命令 "sudo docker build -t cogtif_data_service ." 但是需要用到Python库"cinrad"
# Dockerfile摘抄 RUN pip install --no-cache-dir -r requirements.txt # requirements.txt 部分摘抄 altgraph==0.17.4 APScheduler==3.10.0 Cartopy==0.24.1 certifi==2024.12.14 charset-normalizer==3.4.1 cinrad==1.4 cinrad_data==0.1

报错信息

37.29 Downloading configobj-5.0.9-py2.py3-none-any.whl (35 kB) 37.35 Downloading donfig-0.8.1.post1-py3-none-any.whl (21 kB) 38.09 Building wheels for collected packages: cinrad, cinrad_data, PyYAML 38.09 Building wheel for cinrad (setup.py): started 44.44 Building wheel for cinrad (setup.py): finished with status 'done' 44.63 Created wheel for cinrad: filename=cinrad-1.4-py3-none-any.whl size=44366303 sha256=31f58fc2c9dea4ce76498c00469c708cee927dfd700513420657c4ffe797c270 44.63 Stored in directory: /tmp/pip-ephem-wheel-cache-uq5iuuom/wheels/9a/03/b6/f32ed2d3ce7b680a165dfe821afdf664887c958891df037b0d 44.64 Building wheel for cinrad_data (setup.py): started 52.28 Building wheel for cinrad_data (setup.py): finished with status 'done' 52.53 Created wheel for cinrad_data: filename=cinrad_data-0.1-py3-none-any.whl size=58530728 sha256=33bebbf91163f7526f8ea0f95af2d60d8ef3e3d935ce4b4e311409e03353d852 52.53 Stored in directory: /tmp/pip-ephem-wheel-cache-uq5iuuom/wheels/ba/71/5a/f3379701f63c558ab2e487cf4bba7bd505e9582d40d671b827 52.53 Building wheel for PyYAML (setup.py): started 53.02 Building wheel for PyYAML (setup.py): finished with status 'done' 53.02 Created wheel for PyYAML: filename=PyYAML-5.2-cp312-cp312-linux_x86_64.whl size=44224 sha256=7ac238af87af4ea2847b02eac0c0aa7d148b9d8fc2cfce7d5e0f8bffe21a128b 53.02 Stored in directory: /tmp/pip-ephem-wheel-cache-uq5iuuom/wheels/ce/ec/08/2d47cadc0aa3fe275937ec06a3b3c2a73a33749a21e3a402f3 53.03 Successfully built cinrad cinrad_data PyYAML 53.81 Installing collected packages: pytz, cinrad_data, altgraph, urllib3, tzlocal, tzdata, typing_extensions, traitlets, six, PyYAML, pywin32-ctypes, pyshp, pyparsing, protobuf, platformdirs, pillow, pefile, packaging, numpy, kiwisolver, idna, greenlet, fonttools, cycler, configobj, colorama, click, charset-normalizer, certifi, SQLAlchemy, shapely, scipy, requests, python-dateutil, pyproj, pykdtree, pyinstaller-hooks-contrib, h5py, geobuf, flexparser, flexcache, donfig, contourpy, APScheduler, pyresample, pyinstaller, pooch, Pint, pandas, matplotlib, xarray, vanadis, Cartopy, MetPy, cinrad 58.19 Attempting uninstall: pillow 58.21 Found existing installation: pillow 10.2.0 58.21 Uninstalling pillow-10.2.0: 58.26 Successfully uninstalled pillow-10.2.0 59.30 Attempting uninstall: numpy 59.32 Found existing installation: numpy 1.26.4 59.32 ERROR: Cannot uninstall numpy 1.26.4, RECORD file not found. Hint: The package was installed by debian. ------ Dockerfile:28 -------------------- 26 | # RUN pip install --ignore-installed numpy 27 | # RUN pip install --ignore-installed PyYAML==5.2 28 | >>> RUN pip install --no-cache-dir -r requirements.txt 29 | 30 | -------------------- ERROR: failed to solve: process "/bin/sh -c pip install --no-cache-dir -r requirements.txt" did not complete successfully: exit code: 1

解决方案 -- 修改Dockerfile -- 强制升级numpy

# 强制升级numpy RUN pip install numpy --ignore-installed numpy RUN pip install --no-cache-dir -r requirements.txt

摘抄文章


__EOF__

本文作者国产凌凌漆
本文链接https://www.cnblogs.com/love-zf/p/18689547.html
关于博主:评论和私信会在第一时间回复。或者直接私信我。
版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
声援博主:如果您觉得文章对您有帮助,可以点击文章右下角推荐一下。您的鼓励是博主的最大动力!
posted @   zh89233  阅读(46)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 【.NET】调用本地 Deepseek 模型
· CSnakes vs Python.NET:高效嵌入与灵活互通的跨语言方案对比
· DeepSeek “源神”启动!「GitHub 热点速览」
· 我与微信审核的“相爱相杀”看个人小程序副业
· Plotly.NET 一个为 .NET 打造的强大开源交互式图表库
历史上的今天:
2021-01-24 . net core sdk 的版本 5.0.101 至少需要 msbuild 的 16.8.0 版本。当前可用的 msbuild 版本为 16.6.0.22303。
点击右上角即可分享
微信分享提示