Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Keyes__Mike
Novice
327 Views

Python error on Raspbian 2019.1: ImportError: No module named 'openvino'

I'm trying to use openvino in Python on Raspbian Stretch. I installed on a fresh OS using the instructions on this page: https://docs.openvinotoolkit.org/latest/_docs_install_guides_installing_openvino_raspbian.html  All went well, and the demos ran correctly. 

My python scripts (and the included scripts in /opt/intel/openvino/deployment_tools/inference_engine/samples/python_samples) error out on the openvino import statement:

ImportError: No module named 'openvino'

I did set up setupvars.sh to load automatically when the terminal opens and I see the "[setupvars.sh] OpenVINO environment initialized" message as expected. 

How to fix?

Thanks

0 Kudos
7 Replies
Shubha_R_Intel
Employee
327 Views

Dear Mike, this error always happens when setupvars.sh[bat] was not executed. And you did the right thing by placing your python scripts in /opt/intel/openvino/deployment_tools/inference_engine/samples/python_samples.

Can you retry this time with the manual method - i.e. open up a shell, run the setupvars.sh manually ? If this works, then it must be an error in your automated method.

Thanks kindly,

Shubha 

Keyes__Mike
Novice
327 Views

Thanks for the reply. setupvars.sh was running, after opening the terminal I was able to run commands like "echo $PYTHONPATH" and see values set in the setupvars.sh script, and I was able to see modified values of PYTHONPATH after I changed setupvars.sh and restarted terminal. However, this did not solve my problem.

After some fooling around I was able to get my scripts to run by copying openvino into my dist-packages folder using:

sudo cp -R /opt/intel/openvino/python/python3.5/armv7l/openvino /usr/local/lib/python3.5/dist-packages

Thanks

Shubha_R_Intel
Employee
327 Views

Dear Keyes, Mike,

Glad you solved it. Thanks for using OpenVino !

Shubha

Wios__Ed
Beginner
327 Views

Something not quite right here, I've got the same error straight out of a fresh 2019.1 installation on the Raspbian Stretch. I did something similar as Keyes did by linking openvino one level up and problem solved:

sudo ln -s /opt/intel/openvino/python/python3.5/armv7l/openvino/ /opt/intel/openvino/python/python3.5/openvino

 

nah@dontbother:/opt/intel/openvino/python/python3.5 $ ls
armv7l  cv2.cpython-35m-arm-linux-gnueabihf.so   
nah@dontbother:/opt/intel/openvino/python/python3.5 $ python3 -c "import openvino"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named 'openvino'
nah@dontbother:/opt/intel/openvino/python/python3.5 $ sudo ln -s /opt/intel/openvino/python/python3.5/armv7l/openvino/ /opt/intel/openvino/python/python3.5/openvino
nah@dontbother:/opt/intel/openvino/python/python3.5 $ ls
armv7l  cv2.cpython-35m-arm-linux-gnueabihf.so  openvino   
nah@dontbother:/opt/intel/openvino/python/python3.5 $ python3 -c "import openvino"
nah@dontbother:/opt/intel/openvino/python/python3.5 $ 

 

Shubha_R_Intel
Employee
327 Views

Dear folks,

I have filed a bug on this issue, so hopefully you won't see it in the next OpenVino release !

Thanks for your patience,

Shubha

tuaf__izack
Beginner
327 Views

Hi Keyes, Mike,

Thanks for the fix!

it helped me with the same error on a raspberry after executing setupvars.sh with OpenVino 2019 R1 :)

Chen__Bofu
Beginner
327 Views

Hi all, I made a Debian package for OpenVINO RPi, and it can be installed by the following steps:

$ curl -sL https://raw.githubusercontent.com/DT42/BerryNet-repo/master/setup.sh | sudo -E bash -
$ sudo apt install openvino-rpi

For more details, please refer to https://github.com/DT42/BerryNet-repo