My setup is the following:
- macOS Big Sur
- pyenv
- PyCharm + venv
- Python 3.7.7
- OpenVINO 2021.1.110
I am trying to import OpenVINO:
import openvino
from openvino import inference_engine
This results in the following error when running in PyCharm (i.e. PyCharm configuration that is when using the Play button):
Traceback (most recent call last):
File "/Users/myuser/code/test.py", line 2, in <module>
from openvino import inference_engine
File "/Users/myuser/.pyenv/versions/3.7.7/lib/python3.7/site-packages/openvino/inference_engine/__init__.py", line 1, in <module>
from .ie_api import *
ImportError: dlopen(/Users/myuser/.pyenv/versions/3.7.7/lib/python3.7/site-packages/openvino/inference_engine/ie_api.cpython-37m-darwin.so, 2): Library not loaded: @rpath/libinference_engine.dylib
Referenced from: /Users/myuser/.pyenv/versions/3.7.7/lib/python3.7/site-packages/openvino/inference_engine/ie_api.cpython-37m-darwin.so
Reason: image not found
If I run the same file from the PyCharm terminal it works just fine:
python3 test.py
How can I have it working with PyCharm? I would need to debug some code.
Please take note that every OpenVINO toolkit usage requires the initialization of setupvars.sh.
You can set it permanently or if not, you need to initialize it each time you open a new terminal.
Make sure that the initialization message appears when you init it. It should appear automatically each time you open a new terminal if you had set it permanently.
Just to be sure, make sure that you had everything done according to this guide.