Installation issue: module not found

I’m trying to install openfhe-python with pip and keep getting the following error: ModuleNotFoundError: No module named ‘openfhe.openfhe’. I’ve tried installing it with macOS/pip and with docker/pip. I’m using 3.14 with macOS and Ubuntu:24.04 and python 12 with docker. I’ve tried setting the python path variable but that didn’t fix the issue either. What do I have to do additional to the pip install command?

The short answer is: you should use Python 3.12 with OpenFHE.

We build OpenFHE wheels using the default Python version for Ubuntu 24.04 which is Python 3.12.
Because of that the published Ubuntu 24.04 wheels do not include binaries compatible with Python 3.14 which triggers this error:

ModuleNotFoundError: No module named ‘openfhe.openfhe’

I have Python 3.12 installed and ran this quick test:
/usr/bin/python3.12 -m venv ~/myenv312
source ~/myenv312/bin/activate
pip install openfhe
pip list (openfhe is the only installed package):

Package Version
------- ------------
openfhe 1.5.0.0.24.4
pip 24.0

After that you can simply run
python simple-integers.py
and setting PYTHONPATH is not needed.

Thanks a lot! That seems to work but I’ve tried to deploy it in a docker container and it seems to be very slow. Is it possible to install it directly on Mac? I’ve tried using Python3.12 there as well but keep getting the error.

@helen We do not offer pre-built wheels for MacOS, but you should be able to build your own wheel from source on MacOS. See the build instructions for that.