ImportError: libpython3.7m.so.1.0: cannot open shared object file: No such file or directory

Since months I installed Prodigy 1.10 and I am working with it just fine. Today I wanted to upgrade to Prodigy version 1.11.5 but unfortunately after installing all through prodigy installation command I got this error: ImportError: libpython3.7m.so.1.0: cannot open shared object file: No such file or directory

I checked the similar error in https://support.prodi.gy/t/importerror-libpyton3-7-so-1-0/3290 but it doesn't help.

I checked import spacy and it doesn't work, however, for example, import wasabi works
Here the installed packages using the prodigy installation command in the created environment:

Package Version


aiofiles 0.7.0
blis 0.7.5
cachetools 4.2.4
catalogue 2.0.6
certifi 2021.10.8
charset-normalizer 2.0.7
click 7.1.2
cymem 2.0.6
fastapi 0.68.2
h11 0.12.0
idna 3.3
Jinja2 3.0.2
libpython 0.2
MarkupSafe 2.0.1
murmurhash 1.0.6
numpy 1.21.4
packaging 21.2
pathy 0.6.1
peewee 3.14.8
pip 21.3.1
plac 1.1.3
preshed 3.0.6
prodigy 1.11.5
pydantic 1.8.2
PyJWT 2.3.0
pyparsing 2.4.7
requests 2.26.0
setuptools 39.0.1
smart-open 5.2.1
spacy 3.1.4
spacy-legacy 3.0.8
srsly 2.4.2
starlette 0.14.2
thinc 8.0.13
toolz 0.11.1
tqdm 4.62.3
typer 0.4.0
typing-extensions 3.10.0.2
urllib3 1.26.7
uvicorn 0.13.4
wasabi 0.8.2
zipp 3.6.0

Please note that I don't have a root account in our Linux system so I can't make big changes. Since the installation of the version 1.10 works shouldn't it work also for the version 1.11 ?

any help?

Hi @fsa, similar to the thread you linked, this may still be an environment problem. Here are some potential solutions:

  1. Ensure that the Python environment you're running is the same as where you execute Prodigy

First, I'd like to know if the Python you're running whenever you execute python is the same as the one when you run in your Prodigy environment. Sometimes it may be python3 or even python3.7. Ensure that Prodigy is installed in the same environment. You can type something like:

which python

Afterwards, open the REPL of that python environment and try importing spacy , prodigy or even wasabi.
The important thing is to ensure that your Python environment is the same as where you've installed Prodigy.

  1. Install and Run prodigy inside a virtual environment.

Another option is to install prodigy in a virtual environment and work within that. You can do something like:

python -m venv venv
source venv/bin/activate

Then install Prodigy inside that virtual environment (path/to/venv/bin/pip install prodigy...). So instead of using the "global" Python in your system, you will just use what's provided in your user directory (it's usually path/to/venv/bin/python3).

  1. Figure out where libpython is located in your system and set that in the LD_LIBRARY_PATH environment variable.

Lastly, you can also try things like setting the LD_LIBRARY_PATH before running the command. For example:

# first, let's locate where libpython is
which libpython 

From what I remember, it's usually in /usr/***/libpython.... Afterwards, you can export this directory to the LD_LIBRARY_PATH variable:

export LD_LIBRARY_PATH=<path/to/libpython>

Hi @ljvmiranda921
Thanks a lot for your detailed answer. I will check it and try to solve my problem