Open a-berg opened 2 years ago
If you are using ubuntu or another debian based OS try:
sudo apt-get install libpython3.10
I have the same problem.
When I try sudo apt-get install libpython3.10
, the output is:
Step to reproduce:
conda create -n tf-agents python
conda activate tf-agents
pip install tf-agents[reverb]
python
>>>import reverb
The error I get is:
File "xxx/anaconda3/envs/tf-agents/lib/python3.10/site-packages/reverb/pybind.py", line 4, in <module>
from .libpybind import *
ImportError: libpython3.10.so.1.0: cannot open shared object file: No such file or directory
But I can find the file ( libpython3.10.so.1.0
) in ···/anaconda3/envs/tf-agents/lib
.
Can you help me solve this problem?
Thank you in advance.
I have been having the same problem.
It looks like it is linked to the LD_LIBRARY_PATH environmental variable.
Assuming you are using miniforge3, running this makes the error go away:
export LD_LIBRARY_PATH=~/miniforge3/envs/your_env_name/lib:$LD_LIBRARY_PATH
(libpython3.so is in the lib folder of your environment directory)
Also, when I did that, I found out that pip created an inconsistent environment when it installed reverb using this command from tensorflow
pip install tf-agents[reverb]
With that command, it only works by ensuring numpy>=1.25, with reverb==0.7.0; or lowering the version number of reverb).
Right now, my environment with working version numbers are:
Fixing this will probably mean modifying the activate command to include the */lib directory, since there are a few packages that look like they are depending on it.
I have solved this problem successfully.
If you can find libpython3.10.so.1.0
in /path-to-conda/envs/your-env-name/lib
and your IEDA is 'PyCharm', you can try the following methods:
import reverb
.LD_LIBRARY_PATH=/home/zmli/anaconda3/envs/tf-agents-nightly/lib
in environment variables.
Steps to reproduce:
The error I get is:
It doesn't matter whether I use python 3.8, 3.9 or 3.10 inside the environment. Does reverb expect libpython be installed in the system instead of the conda env and doesn't find it? (IIRC, system python is 2.7.18 / python3 == 3.8.10, defaults to 2.7)