Skip to content

fix: replace deprecated openvino-dev with openvino>=2023.3.0 for Python 3.12+ compat#3678

Open
Aiudadadadf wants to merge 2 commits intoggml-org:masterfrom
Aiudadadadf:fix/issue-3669
Open

fix: replace deprecated openvino-dev with openvino>=2023.3.0 for Python 3.12+ compat#3678
Aiudadadadf wants to merge 2 commits intoggml-org:masterfrom
Aiudadadadf:fix/issue-3669

Conversation

@Aiudadadadf
Copy link

The pip install step for OpenVINO support has been broken on Python 3.12 and later because openvino-dev[pytorch,onnx] - as shipped in the requirements file - resolves to versions that constrain numpy to <1.26.0. Building numpy 1.25.x fails on Python 3.12+ because pkgutil.ImpImporter was removed in that release and older numpy relied on it, producing the AttributeError: module 'pkgutil' has no attribute 'ImpImporter' error seen in the issue.

The right fix is to stop depending on openvino-dev entirely. Intel deprecated that package with the 2023.x cycle and will discontinue it with the 2025.0 release - their own release notes describe openvino-dev as a legacy compatibility shim and recommend migrating to the base openvino package. Starting from OpenVINO 2023.x, model conversion tools and all supported frontends (including ONNX and PyTorch) are bundled in the base openvino package. Pinning to openvino>=2023.3.0 allows any numpy >= 1.16.6 with no upper-bound conflict, which means Python 3.12 and 3.13 can satisfy the constraint from their package repositories without building numpy from source.

The [pytorch,onnx] extras that were passed to openvino-dev are not needed with the base openvino package - those extras existed only to pull in optional model-conversion dependencies that are now built-in.

While looking at convert-whisper-to-openvino.py, there is also a stale from openvino.tools import mo import. The mo name is never referenced anywhere in the script - the encoder conversion uses FrontEndManager and serialize directly. Leaving that import would cause an ImportError with openvino>=2023.x because openvino.tools.mo lives in openvino-dev, not in the base package. Removing the unused import is the correct fix; nothing in the script needs mo.

Tested with:

pip install -r models/requirements-openvino.txt
python -c "from openvino.frontend import FrontEndManager; from openvino.runtime import serialize; print('imports OK')"
pip show openvino | grep -E 'Name|Version|Requires'

On Python 3.12 this previously failed at the pip install stage. With openvino>=2023.3.0 the install completes and the runtime imports resolve correctly.

Fixes #3669

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Openvino build fails since Python 3.12

1 participant