- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Since openvino 2024.1, the python3-openvino-2024.x packages from the APT repositories do not work and the hello_query_device.py only returns an "ModuleNotFoundError: No module named 'openvino._pyopenvino' " error.
This seems to be caused by a pyopenvino .so dynamically library packaged and installed that is built for python 3.8 whereas the versions used with Ubunutu 22.04 or 24.04 are python 3.10 and 3.12 respectively.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
could you share:
- The steps & commands that you did till the point of error?.
- Your references (if available) for clarification purposes.
Cordially,
Iffa
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I exactly followed the step described on Install Intel® Distribution of OpenVINO™ Toolkit for Linux Using APT Repository — OpenVINO™ documentation.
When running
python3 /usr/share/openvino/samples/python/hello_query_device/hello_query_device.py
after the installation, I receive the following:
$ python3 /usr/share/openvino/samples/python/hello_query_device/hello_query_device.py
Traceback (most recent call last):
File "/usr/share/openvino/samples/python/hello_query_device/hello_query_device.py", line 8, in <module>
import openvino as ov
File "/usr/lib/python3/dist-packages/openvino/__init__.py", line 21, in <module>
from openvino import runtime as runtime
File "/usr/lib/python3/dist-packages/openvino/runtime/__init__.py", line 8, in <module>
from openvino._pyopenvino import get_version
ModuleNotFoundError: No module named 'openvino._pyopenvino'
whereas when installing version 2024.0 the output is:
$ python3 /usr/share/openvino/samples/python/hello_query_device/hello_query_device.py
[ INFO ] Available devices:
[ INFO ] CPU :
[ INFO ] SUPPORTED_PROPERTIES:
[ INFO ] AVAILABLE_DEVICES:
[ INFO ] RANGE_FOR_ASYNC_INFER_REQUESTS: 1, 1, 1
[ INFO ] RANGE_FOR_STREAMS: 1, 12
[ INFO ] EXECUTION_DEVICES: CPU
[ INFO ] FULL_DEVICE_NAME: 13th Gen Intel(R) Core(TM) i5-1345URE
...
It looks like the python3-openvino deb packages contain the module for a wrong python version (the machine used has Ubuntu 22.04 with python 3.10).
Working openvino 2024.0 installation:
$ dpkg -L python3-openvino-2024.0.0
...
/usr/lib/python3/dist-packages/openvino
/usr/lib/python3/dist-packages/openvino-2024.0.0-py3.10.egg-info
/usr/lib/python3/dist-packages/openvino-2024.0.0-py3.10.egg-info/PKG-INFO
/usr/lib/python3/dist-packages/openvino-2024.0.0-py3.10.egg-info/SOURCES.txt
/usr/lib/python3/dist-packages/openvino-2024.0.0-py3.10.egg-info/dependency_links.txt
/usr/lib/python3/dist-packages/openvino-2024.0.0-py3.10.egg-info/entry_points.txt
/usr/lib/python3/dist-packages/openvino-2024.0.0-py3.10.egg-info/not-zip-safe
/usr/lib/python3/dist-packages/openvino-2024.0.0-py3.10.egg-info/requires.txt
/usr/lib/python3/dist-packages/openvino-2024.0.0-py3.10.egg-info/top_level.txt
/usr/lib/python3/dist-packages/openvino/__init__.py
/usr/lib/python3/dist-packages/openvino/_offline_transformations
/usr/lib/python3/dist-packages/openvino/_offline_transformations/__init__.py
/usr/lib/python3/dist-packages/openvino/_pyopenvino.cpython-310-x86_64-linux-gnu.so
...
VERSUS broken openvino-2024.2 installation:
$ dpkg -L python3-openvino-2024.2.0
...
/usr/lib/python3/dist-packages/openvino
/usr/lib/python3/dist-packages/openvino-2024.2.0-py3.8.egg-info
/usr/lib/python3/dist-packages/openvino-2024.2.0-py3.8.egg-info/PKG-INFO
/usr/lib/python3/dist-packages/openvino-2024.2.0-py3.8.egg-info/SOURCES.txt
/usr/lib/python3/dist-packages/openvino-2024.2.0-py3.8.egg-info/dependency_links.txt
/usr/lib/python3/dist-packages/openvino-2024.2.0-py3.8.egg-info/entry_points.txt
/usr/lib/python3/dist-packages/openvino-2024.2.0-py3.8.egg-info/not-zip-safe
/usr/lib/python3/dist-packages/openvino-2024.2.0-py3.8.egg-info/requires.txt
/usr/lib/python3/dist-packages/openvino-2024.2.0-py3.8.egg-info/top_level.txt
/usr/lib/python3/dist-packages/openvino/__init__.py
/usr/lib/python3/dist-packages/openvino/_offline_transformations
/usr/lib/python3/dist-packages/openvino/_offline_transformations/__init__.py
/usr/lib/python3/dist-packages/openvino/_pyopenvino.cpython-38-x86_64-linux-gnu.so
...
See the py3.10.egg vs py3.8.egg and cpython-310 vs cpython-38 in the packaged python files.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
what I noticed is, you need to carefully choose the correct repo in this section
I managed to install and use OV without issue if I do so:
Build is successful
Query device script can be run.
Else, if you added the wrong repo, the build will crash halfway and the query device script will fail:
Crashed at 62% & the terminal automatically closed
Query device script fail with the same error as yours.
Please ensure you choose and add the correct repo according to Ubuntu version.
Cordially,
Iffa
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Iffa,
I'm using the correct repos:
$ cat /etc/os-release
PRETTY_NAME="Ubuntu 22.04.4 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.4 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy
$ cat /etc/apt/sources.list.d/intel-openvino-2024.list
deb https://apt.repos.intel.com/openvino/2024 ubuntu22 main
and
$ cat /etc/os-release
PRETTY_NAME="Ubuntu 24.04 LTS"
NAME="Ubuntu"
VERSION_ID="24.04"
VERSION="24.04 LTS (Noble Numbat)"
VERSION_CODENAME=noble
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=noble
LOGO=ubuntu-logo
$ cat /etc/apt/sources.list.d/intel-openvino-2024.list
deb https://apt.repos.intel.com/openvino/2024 ubuntu24 main
Several colleagues are facing the same issues, the OpenVINO 2024.1 and 2024.2 Python bindings deb packages from the Ubuntu 22 and 24 apt repositories are broken or the wrong ones (matching and built for Ubuntu 20).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We'll further investigate this and get back to you.
Cordially,
Iffa
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I can confirm Johannes' observations.
I have fresh Ubuntu 22.04 LTS installation and I think that I have the appropriate sources for OpenVINO 2024.2:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.4 LTS
Release: 22.04
Codename: jammy
$ cat /etc/apt/sources.list.d/intel-openvino-2024.list
deb [signed-by=/usr/share/keyrings/openvino-archive-keyring.gpg] https://apt.repos.intel.com/openvino/2024 ubuntu22 main
When I run the Hello Query Device Python sample application, it fails, because I have Python 3.10, whereas OpenVINO is installed with libraries for Python 3.8:
$ python3 /usr/share/openvino/samples/python/hello_query_device/hello_query_device.py
Traceback (most recent call last):
File "/usr/share/openvino/samples/python/hello_query_device/hello_query_device.py", line 8, in <module>
import openvino as ov
File "/usr/lib/python3/dist-packages/openvino/__init__.py", line 21, in <module>
from openvino import runtime as runtime
File "/usr/lib/python3/dist-packages/openvino/runtime/__init__.py", line 8, in <module>
from openvino._pyopenvino import get_version
ModuleNotFoundError: No module named 'openvino._pyopenvino'
$ sudo find / -name "*_pyopenvino*"
/usr/lib/python3/dist-packages/openvino/_pyopenvino.cpython-38-x86_64-linux-gnu.so
$ python3 --version
Python 3.10.12
A colleague of mine has reported that the issue does not occur if he creates a Python venv before he installs OpenVINO. If he uses a Python venv, he receives the libraries for Python 3.10.
Could it be possible that the OpenVINO installer has an issue with identifying the correct Python version if a native environment is used?
![](/skins/images/8C80966F940F80D854AEDDDACECA968C/responsive_peak/images/icon_anonymous_message.png)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page