Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

OpenSSL FIPS selftest failure when importing cv2 on FIPS-enabled systems

未关闭
#1,191 18 条评论 14 个 reaction 已指派 1 人 在 GitHub 查看

@asmorkalov 已经在做这个了。

开始于 2026年1月26日。

评估

这个 Issue 还没有评估数据。

描述

bug
System Information
  • OS: RHEL 9.7 with FIPS enabled
  • Python 3.13.7
  • opencv-python==4.13.0.90
Detailed description

Importing cv2 crashes with FATAL FIPS SELFTEST FAILURE on systems with FIPS mode enabled.

The crash occurs when loading the native cv2 binary extension in cv2/__init__.py:

py_module = sys.modules.pop("cv2")
native_module = importlib.import_module("cv2")  # <-- crashes here

The cv2 binary appears to be linked against the OpenSSL in a way that fails FIPS validation on FIPS-enabled systems.

Reverting to the previous release currently provides a workaround.

[vmiller@gluskap tmp]$ uv venv
Using CPython 3.13.7
Creating virtual environment at: .venv
Activate with: source .venv/bin/activate
[vmiller@gluskap tmp]$ venv
(tmp) [vmiller@gluskap tmp]$ uv pip install "opencv-python<4.13.0.90"
Resolved 2 packages in 135ms
Prepared 2 packages in 10.33s
Installed 2 packages in 20ms
 + numpy==2.2.6
 + opencv-python==4.12.0.88
(tmp) [vmiller@gluskap tmp]$ python -c "import cv2; print('success');"
success
Steps to reproduce

On a machine installed with fips=1:

[vmiller@gluskap tmp]$ uv venv
Using CPython 3.13.7
Creating virtual environment at: .venv
Activate with: source .venv/bin/activate
[vmiller@gluskap tmp]$  venv
(tmp) [vmiller@gluskap tmp]$ uv pip install opencv-python
Resolved 2 packages in 402ms
Prepared 2 packages in 1.83s
Installed 2 packages in 19ms
 + numpy==2.4.1
 + opencv-python==4.13.0.90
(tmp) [vmiller@gluskap tmp]$ python -c "import cv2"
crypto/fips/fips.c:154: OpenSSL internal error: FATAL FIPS SELFTEST FAILURE
Aborted
Issue submission checklist
  • I report the issue, it's not a question
  • I checked the problem with documentation, FAQ, open issues, forum.opencv.org, Stack Overflow, etc and have not found any solution
  • I updated to the latest OpenCV version and the issue is still there
  • There is reproducer code and related data files (videos, images, onnx, etc)
主要语言
Python
星标
5.4k
派生
1k
平均合并
22 小时 17 分钟
30 天内合并 PR
3

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

opencv/opencv-python 的其他 Issue

查看 opencv/opencv-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。