# Openfhe-python on linux fails

**URL:** <https://openfhe.discourse.group/t/openfhe-python-on-linux-fails/1206>\
**Category:** OpenFHE ports/wrappers\
**Created:** [April 18, 2024, 4:14pm UTC](https://openfhe.discourse.group/t/openfhe-python-on-linux-fails/1206 "2024-04-18T16:14:03Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![svetlana](https://avatars.discourse-cdn.com/v4/letter/s/cdc98d/32.png) [@svetlana](https://openfhe.discourse.group/u/svetlana)\
**Post date:** [April 18, 2024, 4:14pm UTC](https://openfhe.discourse.group/t/openfhe-python-on-linux-fails/1206/1 "2024-04-18T16:14:03Z")

</div>

Hello, I’ve installed openfhe-python on linux following all steps from [GitHub - openfheorg/openfhe-python: Official Python wrapper for OpenFHE. Current release is v0.8.6 (released on March 12, 2024).](https://github.com/openfheorg/openfhe-python) . I am facing the following error testing an example from [openfhe-python/examples/pke/simple-integers.py at main · openfheorg/openfhe-python · GitHub](https://github.com/openfheorg/openfhe-python/blob/main/examples/pke/simple-integers.py) :

Traceback (most recent call last):  
File “”, line 1027, in \_find\_and\_load  
File “”, line 1006, in \_find\_and\_load\_unlocked  
File “”, line 688, in \_load\_unlocked  
File “”, line 883, in exec\_module  
File “”, line 241, in \_call\_with\_frames\_removed  
File “/home//PycharmProjects/HETest/.venv/lib/python3.10/site-packages/openfhe/ **init**.py”, line 1, in   
from .openfhe import \*  
ImportError: /home//PycharmProjects/HETest/.venv/lib/python3.10/site-packages/openfhe/openfhe.so: undefined symbol: \_ZN8lbcrypto12DCRTPolyImplIN9bigintdyn9mubintvecINS1\_5ubintImEEEEE2atEj

Could you please help me?

---

<div class="post-metadata">

**Author:** ![ypolyakov](https://yyz1.discourse-cdn.com/flex031/user_avatar/openfhe.discourse.group/ypolyakov/32/47_2.png) [@ypolyakov](https://openfhe.discourse.group/u/ypolyakov)\
**Post date:** [April 21, 2024, 10:30pm UTC](https://openfhe.discourse.group/t/openfhe-python-on-linux-fails/1206/2 "2024-04-21T22:30:05Z")

</div>

Hi @svetlana,

I am not aware of any issues at the moment. Are you using the `main` branches of both OpenFHE and OpenFHE-Python? What OS and compilers are you using? Are you using the system-level or conda installation instructions?

The error you included seems to indicate an incompatibility between the .so files for OpenFHE and the Python wrapper. Please confirm you install the latest versions on your system (v1.1.4 and v0.8.6 for OpenFHE and Python wrapper, accordingly).

---

<div class="post-metadata">

**Author:** ![diogocardoso28](https://avatars.discourse-cdn.com/v4/letter/d/e99b99/32.png) [@diogocardoso28](https://openfhe.discourse.group/u/diogocardoso28)\
**Post date:** [April 22, 2024, 2:14pm UTC](https://openfhe.discourse.group/t/openfhe-python-on-linux-fails/1206/3 "2024-04-22T14:14:06Z")

</div>

I also got the same error on arch, I installed both from their respective github repos. I should also note that I’m running pycharm, so it’s possible that it might have something to do with the venv.  
However If I run from my terminal I get other error (c++ openfhe works fine):

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/openfhe/original/1X/2f0efe878176703bf25810c7ab4fe932e64406a8.png)

---

<div class="post-metadata">

**Author:** ![Caesar](https://yyz1.discourse-cdn.com/flex031/user_avatar/openfhe.discourse.group/caesar/32/63_2.png) [@Caesar](https://openfhe.discourse.group/u/Caesar)\
**Post date:** [April 22, 2024, 4:00pm UTC](https://openfhe.discourse.group/t/openfhe-python-on-linux-fails/1206/4 "2024-04-22T16:00:35Z")

</div>

Apparently, for the terminal error, you need to add the path of OpenFHE to your LD\_LIBRARY\_PATH.  
Use the following:  
`export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/openfhe/library`

---

<div class="post-metadata">

**Author:** ![diogocardoso28](https://avatars.discourse-cdn.com/v4/letter/d/e99b99/32.png) [@diogocardoso28](https://openfhe.discourse.group/u/diogocardoso28)\
**Post date:** [April 22, 2024, 7:13pm UTC](https://openfhe.discourse.group/t/openfhe-python-on-linux-fails/1206/5 "2024-04-22T19:13:56Z")

</div>

yea that did it, but now shows same error as if run trough pycharm:

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/openfhe/original/1X/30fad84f039fe1ffe9640856085dd390f4fb66b1.png)

---

<div class="post-metadata">

**Author:** ![diogocardoso28](https://avatars.discourse-cdn.com/v4/letter/d/e99b99/32.png) [@diogocardoso28](https://openfhe.discourse.group/u/diogocardoso28)\
**Post date:** [April 22, 2024, 7:14pm UTC](https://openfhe.discourse.group/t/openfhe-python-on-linux-fails/1206/6 "2024-04-22T19:14:27Z")

</div>

I’ve also tried updating/installing everything related to libcrypto but everything checked out

---

<div class="post-metadata">

**Author:** ![diogocardoso28](https://avatars.discourse-cdn.com/v4/letter/d/e99b99/32.png) [@diogocardoso28](https://openfhe.discourse.group/u/diogocardoso28)\
**Post date:** [April 22, 2024, 8:21pm UTC](https://openfhe.discourse.group/t/openfhe-python-on-linux-fails/1206/7 "2024-04-22T20:21:02Z")

</div>

> [@Caesar](#):
>
> export LD\_LIBRARY\_PATH=$LD\_LIBRARY\_PATH:/path/to/openfhe/library

Got it working nicely with Autocompletion and everything. Here’s how to do it:

1. Install OpenFHE trough the IDE package manager
2. Copy your built openfhe .so file () to the openfhe folder inside the .venv folder
3. Rename said file to openfhe.so (mine was openfhe.cpython-311-x86\_64-linux-gnu.so), delete the installed by ide first
4. Create a custom configuration for your run file on the IDE with this env variable (LD\_LIBRARY\_PATH=$LD\_LIBRARY\_PATH:/path/to/openfhe/library/),  
It should look something like this:  
 ![image](https://canada1.discourse-cdn.com/flex031/uploads/openfhe/original/1X/5f223ab2464a693136d4764e88e938cc4509290d.png)
5. That’s it It should work. 😃

---

<div class="post-metadata">

**Author:** ![svetlana](https://avatars.discourse-cdn.com/v4/letter/s/cdc98d/32.png) [@svetlana](https://openfhe.discourse.group/u/svetlana)\
**Post date:** [April 23, 2024, 8:21am UTC](https://openfhe.discourse.group/t/openfhe-python-on-linux-fails/1206/8 "2024-04-23T08:21:06Z")

</div>

Hi @ypolyakov, I am using the main branches and the latest versions are installed - v1.1.4 and v0.8.6 for OpenFHE and Python wrapper, respectively. Also, I am using Ubuntu 22.04.4 and the system-level installation. It still does not work.

---

<div class="post-metadata">

**Author:** ![svetlana](https://avatars.discourse-cdn.com/v4/letter/s/cdc98d/32.png) [@svetlana](https://openfhe.discourse.group/u/svetlana)\
**Post date:** [April 23, 2024, 11:06am UTC](https://openfhe.discourse.group/t/openfhe-python-on-linux-fails/1206/9 "2024-04-23T11:06:35Z")

</div>

@ypolyakov , hello again, it works now, changing the IDE from pychams to VS code helped.
