Checkout openfhe-python source code and its dependencies.
Make a new virtual environment in another directory.
pip install directory-of/openfhe-python
python -c "import('openfhe')"
Cause of the problem:
The openfhe-python library uses an init.py file that has a local import statement. When you run that local import from a different location on disk, it looks in a place relative to that different location, so it doesn't find the .so.
The relative import that is currently there:
from .openfhe import *
Suggested fix:
Use an absolute import statement, so that it is relative to the base of the library, not the current directory.
To recreate this problem:
Cause of the problem:
The openfhe-python library uses an init.py file that has a local import statement. When you run that local import from a different location on disk, it looks in a place relative to that different location, so it doesn't find the .so.
The relative import that is currently there:
Suggested fix:
Use an absolute import statement, so that it is relative to the base of the library, not the current directory.