openfheorg / openfhe-python

Official Python wrapper for OpenFHE. Current release is v0.8.8 (released on June 25, 2024).
https://openfheorg.github.io/openfhe-python/html/index.html
BSD 2-Clause "Simplified" License
60 stars 18 forks source link

Pycharm IDE autocompletion #134

Open DarkFrak74 opened 1 month ago

DarkFrak74 commented 1 month ago

I tried installing openfhe-python both on system-level linux and in Conda environment, then setting the pycharm workspace with that interpreter. The files run without errors, however pycharm doesn't recognize the library, hence autocompletion doesn't work properly. image

Rinoex commented 1 month ago

I've confronted this issue for several days but finally I installed openfhe python using conda on linux as a normal user. You can run /path/to/your/miniconda3/envs/openfhe/bin/python -c "import openfhe". If it succeeds without an error, then the openfhe is successfully installed into your Conda.

Otherwise, run conda list openfhe. If openfhe is not listed, you need to install openfhe-python again.

To install it, In your openfhe-python directory, run pip install -e . instead of conda develop lib.

If any error occurs, run find /path/to/your/openfhe-python -name *.so. If no files are found, it reveals that openfhe python is not built successfully, you need to build it following the install tutorial.

btw, have you tried run make testall after installing openfhe-development? Please make sure it works. If there is any error, you have to build openfhe-development and openfhe-python again from the beginning.

Hope it helps you :)

DarkFrak74 commented 1 month ago

Hi, and thanks for the support. Somehow the library (but not the autocompletion) worked even before trying what you suggested. The import openfhe command didn't work, due to a GLIBCXX_3.4.32 not found error. However the pip install successfully installed the library, and now it's even shown in pycharm packet manager, but still the autocompletion doesn't work... The strange thing is that, with the exact same conda env and interpreter, it works in the interactive shell

Rinoex commented 1 month ago

oh that's really strange.. i have no idea how come it does, maybe you have tred fix the glibxcxx not found error?

DarkFrak74 commented 1 month ago

Yep, I fixed that by manually linking my local libc with conda env:

https://askubuntu.com/questions/1418016/glibcxx-3-4-30-not-found-in-conda-environment