Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.
6458 Discussions

Ubuntu 22.04 and 24.04 python3-openvino packages and thereby APT installation broken

JohannesQ
Employee
354 Views

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.

6 Replies
Iffa_Intel
Moderator
243 Views

Hi,


could you share:

  1. The steps & commands that you did till the point of error?.
  2. Your references (if available) for clarification purposes.



Cordially,

Iffa


0 Kudos
JohannesQ
Employee
221 Views

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.

0 Kudos
Iffa_Intel
Moderator
142 Views

Hi,

 

what I noticed is, you need to carefully choose the correct repo in this section

Iffa_Intel_0-1721662578289.png

 

I managed to install and use OV without issue if I do so:

Build is successful

1_ub20.JPG

Query device script can be run.

2_ub20.JPG

 

 

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

1_22ub.JPG

Query device script fail with the same error as yours.

2_22ub.JPG

 

Please ensure you choose and add the correct repo according to Ubuntu version.

 

Cordially,

Iffa

 

0 Kudos
JohannesQ
Employee
108 Views

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).

  

Iffa_Intel
Moderator
75 Views

We'll further investigate this and get back to you.



Cordially,

Iffa


0 Kudos
Matthias1102
Employee
29 Views

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?

0 Kudos
Reply