Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] penvino/inference_engine/__init__.py", line 30, in <module> from .ie_api import * ImportError: libpython3.8.so.1.0: cannot open shared object file: No such file or directory #9523

Closed
lucasjinreal opened this issue Jan 6, 2022 · 14 comments
Assignees
Labels

Comments

@lucasjinreal
Copy link

penvino/inference_engine/init.py", line 30, in
from .ie_api import *
ImportError: libpython3.8.so.1.0: cannot open shared object file: No such file or directory

@lucasjinreal lucasjinreal added bug Something isn't working support_request labels Jan 6, 2022
@alalek
Copy link

alalek commented Jan 6, 2022

Please provide more information:

  • how did you get OpenVINO? which version?
  • python3 --version
  • python3 -c "import sys; print(sys.path)"
  • LD_DEBUG=libs python3 -c "from .ie_api import *" (attach output as .txt file)
  • ldd <path_to_ie_api.so>

@jgespino jgespino added category: Python API OpenVINO Python bindings and removed bug Something isn't working labels Jan 6, 2022
@lucasjinreal
Copy link
Author

@alalek I just install openvino from pip install openvino. can not import it.

@Iffa-Intel
Copy link

Iffa-Intel commented Jan 7, 2022

Hi @jinfagang ,

The libpython3.8.so file might not exist in your system, hence causing the error.
Please help to share all information requested by @alalek.
This would help us to narrow down the cause of the issue.

@dkurt
Copy link
Contributor

dkurt commented Jan 7, 2022

Have you installed libpython3.8-dev? Which OS is used?

@lucasjinreal
Copy link
Author

@dkurt @Iffa-Meah hi, I will update my os env and detailed output once get home. am using ubuntu 20.04, I think I have libpython3.8-dev installed.

@lucasjinreal
Copy link
Author

lucasjinreal commented Jan 11, 2022

@dkurt Sorry for late reply. I just double check:

locate libpython3.8.so.1.0                                                                          bm/
/snap/gnome-3-38-2004/76/usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0
/snap/gnome-3-38-2004/87/usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0
/snap/ogre-meshviewer/494/usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0

Seems my system version is:

Python 3.8.5 (default, Sep  4 2020, 07:30:14) 

So I maybe don't have this .so? How should I install it?

BTW, why does users have install this specific version of libpython3.8.s0.1.0? For users like me python3.8.5 not work? then what about python3.9? and python3.8.4? I am confused here.

@lucasjinreal
Copy link
Author

lucasjinreal commented Jan 11, 2022

@dkurt Oh, sorry. I just checked am using anaconda, and seems libpython3.8.so.1.0 actually exist already:

ls ~/anaconda3/lib/ | grep python                                                               130 bm/
libpython3.8.a
libpython3.8.nolto.a
libpython3.8.so
libpython3.8.so.1.0
libpython3.so
python3.8

why it doesn't found it?

Now, this is confusing:

image

@Iffa-Intel
Copy link

Iffa-Intel commented Jan 12, 2022

@jinfagang

If you intend to use the Python Package from Anaconda, it is recommended to create a virtual environment using anaconda. Activate the venv, make sure all OpenVINO pre-requisite installed, then pip install openvino. This should direct the Python Package from Anaconda to be used with OpenVINO.

The proper steps would be:

  1. Create venv: conda create --name py37 python=3.7
  2. Activate the venv: conda activate py37
  3. Update Anaconda: conda update --all
  4. Install numpy: conda install numpy
  5. Install OpenVINO (install according to your ubuntu version): conda install openvino-ie4py-ubuntu20 -c intel
  6. Verify: python -c "from openvino.inference_engine import IECore"

conda

You may refer here.

@lucasjinreal
Copy link
Author

@Iffa-Meah thanks a ton. I will try it later on.

BTW, why using base env and pip install openvino doesn't work here? As you can see, I am using base env which is also an venv in conda.

@Iffa-Intel
Copy link

Iffa-Intel commented Jan 13, 2022

@jinfagang, it is not recommended to put any program in the base environment which is also emphasized by the official Anaconda guide. In order to know further, you probably need to find out from Anaconda itself. Probably it's related to how they manage the packages.

This issue can be solved by building the Python API wrapper and specifying an exact Python version, only if you build from source: Build on Linux Systems

In your case, it is recommended to create a virtual environment in Anaconda and install OpenVINO there. This would guarantee the usability of OpenVINO and the Python packages.

@lucasjinreal
Copy link
Author

@Iffa-Meah thanks, I though openvino doesn't opensource all code before. does openvino opensourced just like tensorrt? Only opensource OSS but not core lib?

@Iffa-Intel
Copy link

Iffa-Intel commented Jan 14, 2022

@jinfagang , for building from source, you'll need to do the setup as in the link I provided above.
Once the setup is successful, you can clone the Open Model Zoo repository and get the pre-trained models/sample app.
Here is the repo: Open_Model_Zoo.

@Iffa-Intel
Copy link

Closing issue, feel free to re-open or start a new issue if additional assistance is needed.

@AlexHex7
Copy link

@jinfagang Hi, you should install libpython3.8 in your ubuntu system.

sudo apt-get install libpython3.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants