Community
cancel
Showing results for 
Search instead for 
Did you mean: 
hochi__andre
Beginner
6,772 Views

ModuleNotFoundError: No module named 'openvino'

I have an import error where I can't import from openvino. I ran the installation correctly and ran the two files (demo_squeezenet_download_convert_run.bat and demo_security_barrier_camera.bat) that are required to check if the installation worked fine. But when trying to run classification_sample.py The import error comes up. 

I am running on Windows, python 3.6.5, and do not have a intel GPU.

0 Kudos
19 Replies
Shubha_R_Intel
Employee
6,772 Views

Dear hochi, andre,

Did you run C:\Program Files (x86)\IntelSWTools\openvino_2019.1.148\bin\setupvars.bat first ? Also are you using the latest and greatest OpenVino release - 2019 R1.1 ? 

If you don't have an Intel integrated GPU, that's OK. classification_sample.py by default will run on a CPU.

Thanks,

Shubha

hochi__andre
Beginner
6,772 Views

Yes I have, I believe that file is supposed to set up the paths. When I run it a screen appears for .1 seconds then disappears.

hochi__andre
Beginner
6,772 Views

But I still have the import error.

hochi__andre
Beginner
6,772 Views

Also Yes I am running OpenVino 2019 R1.1

 

hochi__andre
Beginner
6,772 Views

Shubha_R_Intel
Employee
6,772 Views

Dear hochi, andre,

So you are running Windows 10 right ? From a command shell (DOS) after you run setupvars.bat, please type echo %PYTHONPATH% . Please post the result here.

Thanks,

Shubha

XWang97
Beginner
6,772 Views

Hi.

I have run: "C:\Program Files (x86)\IntelSWTools\openvino\bin\setupvars.bat".

And I got:

Python 3.6.4
ECHO is off.
PYTHONPATH=C:\Program Files (x86)\IntelSWTools\openvino\python\pythonprogram.or;C:\Program Files (x86)\IntelSWTools\openvino\python\pythonprogram.or
[setupvars.bat] OpenVINO environment initialized

But I still get: ModuleNotFoundError: No module named 'openvino', because of  from openvino.inference_engine import IENetwork, IEPlugin

STyur
New Contributor I
6,772 Views

"C:\Program Files (x86)\IntelSWTools\openvino\bin\setupvars.bat" have to be run from command prompt window each time as you open cmd.

then, after that, you can run 'python3 classification_sample.py' in this cmd window

6,772 Views

Hi, have you solved the problem? Maybe the execution of setupvars.bat hadn't taken effect yet. Have you checked whether the environment variables had been all set? Try to run it again and log off then log in again then check your environment variables. if the same problem still occurs maybe you should check out this link and set the variables manually.

Shubha_R_Intel
Employee
6,772 Views

Hello everyone, 

OpenVino 2019R2 just got released yesterday. Please download it and give it a try !

Thanks,

Shubha

6,772 Views

I've followed all the installation instructions for Ubuntu and it has this problem. setupvars are already set and working. What should I do now?

6,772 Views

I have this problem with ubuntu. setupvars.sh was executed so the problem comes from somewhere else.

[setupvars.sh] OpenVINO environment initialized
pabloz@pabloz-HP-Laptop:~/desarrollo/safety-gear-detector-python/application$ python3 -c "import cv2; print(cv2.__version__)"
4.2.0-openvino
pabloz@pabloz-HP-Laptop:~/desarrollo/safety-gear-detector-python/application$ python3 -c "import openvino; print(openvino.__version__)"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
AttributeError: module 'openvino' has no attribute '__version__'
pabloz@pabloz-HP-Laptop:~/desarrollo/safety-gear-detector-python/application$ sudo python3 ./safety_gear_detector.py -d CPU -m /opt/intel/openvino/deployment_tools/open_model_zoo/tools/downloader/intel/person-detection-retail-0013/FP32/person-detection-retail-0013.xml -sm ../resources/worker-safety-mobilenet/FP32/worker_safety_mobilenet.xml -e /opt/intel/openvino/deployment_tools/inference_engine/lib/intel64/libcpu_extension_avx2.so
Traceback (most recent call last):
  File "./safety_gear_detector.py", line 33, in <module>
    from inference import Network
  File "/home/pabloz/desarrollo/safety-gear-detector-python/application/inference.py", line 28, in <module>
    from openvino.inference_engine import IENetwork, IECore
ModuleNotFoundError: No module named 'openvino'

Also, the "rich text" formatting options of this website to share these lines are terrible.

Ba_Van__Nguyen
Beginner
6,772 Views

 

Have you solved this error yet? How did you do it? I also have the same problem

6,772 Views

Not working. What am I missing?

[setupvars.sh] OpenVINO environment initialized
pabloz@pabloz-HP-Laptop:~/desarrollo/safety-gear-detector-python/application$ python3 -c "import cv2; print(cv2.__version__)"
4.2.0-openvino
pabloz@pabloz-HP-Laptop:~/desarrollo/safety-gear-detector-python/application$ python3 -c "import openvino; print(openvino.__version__)"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
AttributeError: module 'openvino' has no attribute '__version__'
pabloz@pabloz-HP-Laptop:~/desarrollo/safety-gear-detector-python/application$ sudo python3 ./safety_gear_detector.py -d CPU -m /opt/intel/openvino/deployment_tools/open_model_zoo/tools/downloader/intel/person-detection-retail-0013/FP32/person-detection-retail-0013.xml -sm ../resources/worker-safety-mobilenet/FP32/worker_safety_mobilenet.xml -e /opt/intel/openvino/deployment_tools/inference_engine/lib/intel64/libcpu_extension_avx2.so
Traceback (most recent call last):
  File "./safety_gear_detector.py", line 33, in <module>
    from inference import Network
  File "/home/pabloz/desarrollo/safety-gear-detector-python/application/inference.py", line 28, in <module>
    from openvino.inference_engine import IENetwork, IECore

Ba_Van__Nguyen
Beginner
6,772 Views

Hi.

I have run: "C:\Program Files (x86)\IntelSWTools\openvino\bin\setupvars.bat".

And i got:

 Python 3.7.6
ECHO is off.
PYTHONPATH=C:\Program Files (x86)\IntelSWTools\openvino_2019.3.379\deployment_tools\open_model_zoo\tools\accuracy_checker;C:\Program Files (x86)\IntelSWTools\openvino_2019.3.379\python\python3.7;C:\Program Files (x86)\IntelSWTools\openvino_2019.3.379\python\python3;
[setupvars.bat] OpenVINO environment initialized

But I still get: ModuleNotFoundError: No module named 'openvino'.

I have tried on many versions but none of them solved the problem. Please help me

 

mohamed__tamer
Beginner
6,772 Views

if you are using visual studio code, open your project , go to cmd terminal and run the setupvars.bat file you run in the cma

iconnor
Beginner
6,772 Views

Having the same problem.  ubuntu 18.04

/opt/intel/openvino/bin/setupvars.sh 
[setupvars.sh] OpenVINO environment initialized
echo $PYTHONPATH

nothing is printed.  env shows no variables set specific to openvino.  The setupvars.sh script is not having any effect.

iconnor
Beginner
6,772 Views

Fixed it. Instead of running /opt/intel/openvino/setupvars.sh, you have to source it.

source /opt/intel/openvino/setupvars.sh

echo $PYTHONPATH
/opt/intel/openvino_2020.2.120/python/python3.6:/opt/intel/openvino_2020.2.120/python/python3:/opt/intel/openvino_2020.2.120/deployment_tools/open_model_zoo/tools/accuracy_checker:/opt/intel/openvino_2020.2.120/deployment_tools/model_optimizer:/opt/intel/openvino_2020.2.120/data_processing/dl_streamer/python:/opt/intel/openvino_2020.2.120/data_processing/gstreamer/lib/python3.6/site-packages:/opt/intel/openvino_2020.2.120/python/python3.6:/opt/intel/openvino_2020.2.120/python/python3:/opt/intel/openvino_2020.2.120/deployment_tools/open_model_zoo/tools/accuracy_checker:/opt/intel/openvino_2020.2.120/deployment_tools/model_optimizer:/opt/intel/openvino_2020.2.120/data_processing/dl_streamer/python:/opt/intel/openvino_2020.2.120/data_processing/gstreamer/lib/python3.6/site-packages:

zian123
Novice
381 Views

Hi I am facing the same problem as "No Module named Openvino", But I dont know how to fix it. Can you please tell me how you fixed that. I dint get your solution,

 Instead of running /opt/intel/openvino/setupvars.sh, you have to source it.

source /opt/intel/openvino/setupvars.sh

How to do this? where to right this?

Thanks

Reply