microsoft / EVA

Compiler for the SEAL homomorphic encryption library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

eva import fails with Python 3.8.5

holgerroth opened this issue · comments

I'm getting this error after successful compilation and pip install on Ubuntu 20.04 with Python 3.8.5

pip3 install python/.
Processing ./python
Building wheels for collected packages: eva
  Building wheel for eva (setup.py) ... done
  Created wheel for eva: filename=eva-1.0.0-cp38-cp38-linux_x86_64.whl size=2014160 sha256=3f2f531efb8fb7860e413fcb22983cdd9c4e3cd075cf90012cbb24f6de4cc5bb
  Stored in directory: /tmp/pip-ephem-wheel-cache-7gz0p8dr/wheels/29/d5/97/d004a0d73f92dfdca9ed66648f34bf84be5de4325b55dd89db
Successfully built eva
Installing collected packages: eva
  Attempting uninstall: eva
    Found existing installation: eva 1.0.0
    Uninstalling eva-1.0.0:
      Successfully uninstalled eva-1.0.0
Successfully installed eva-1.0.0
python3 tests/all.py
Traceback (most recent call last):
  File "tests/all.py", line 4, in <module>
    from bug_fixes import *
  File "/home/hroth/Code2/EVA/tests/bug_fixes.py", line 5, in <module>
    from common import *
  File "/home/hroth/Code2/EVA/tests/common.py", line 6, in <module>
    from eva import evaluate
  File "/home/hroth/.local/lib/python3.8/site-packages/eva/__init__.py", line 4, in <module>
    from ._eva import *
ModuleNotFoundError: No module named 'eva._eva'

Thank you for the report! I will look into this.

Having the same issue with latest src and python 3.6.12

Here's an update on this issue. The problem is most likely that the _eva.cpython-38-x86_64-linux-gnu.so native library was not installed with the eva package.

I wasn't able to reproduce from a clean install of Ubuntu 20.04, where the system Python version was 3.8.5 and I installed pip with get-pip.py for the user. However, after building EVA if I remove python/eva/_eva.cpython-38-x86_64-linux-gnu.so, then installing the package with python3 -m pip install python/. still succeeds without errors, but at runtime eva._eva will not be found.

@holgerroth could you verify that python/eva/_eva.cpython-38-x86_64-linux-gnu.so exists for you after you've built EVA?

That file doesn't exist after the build:

(3.6.12/envs/venv)
/mnt/c/Users/bazzilic/path/to/project/EVA/python/eva [git::main *] [bazzilic@X1CARBON] [16:49]
> ls -ahl
total 40K
drwxr-xr-x 1 bazzilic bazzilic 4.0K Dec 30 23:39 .
drwxr-xr-x 1 bazzilic bazzilic 4.0K Dec 30 23:38 ..
drwxr-xr-x 1 bazzilic bazzilic 4.0K Dec 30 20:12 CMakeFiles
-rw-r--r-- 1 bazzilic bazzilic  357 Dec 30 20:10 CMakeLists.txt
-rw-r--r-- 1 bazzilic bazzilic 8.8K Dec 30 20:12 Makefile
-rw-r--r-- 1 bazzilic bazzilic 5.8K Dec 30 20:10 __init__.py
drwxr-xr-x 1 bazzilic bazzilic 4.0K Dec 30 23:39 __pycache__
drwxr-xr-x 1 bazzilic bazzilic 4.0K Dec 30 20:10 ckks
-rw-r--r-- 1 bazzilic bazzilic 1.2K Dec 30 20:12 cmake_install.cmake
-rw-r--r-- 1 bazzilic bazzilic  576 Dec 30 20:10 metric.py
drwxr-xr-x 1 bazzilic bazzilic 4.0K Dec 30 20:10 seal
drwxr-xr-x 1 bazzilic bazzilic 4.0K Dec 30 20:10 std
-rw-r--r-- 1 bazzilic bazzilic 9.4K Dec 30 20:10 wrapper.cpp

This is weird. The python/eva/_eva.cpython-38-x86_64-linux-gnu.so file is the output of the eva_py build target, which is created in python/eva/CMakeLists.txt with a pybind11_add_module(eva_py wrapper.cpp) command. pybind11 itself is included as a submodule under third_party/pybind11, and I just tested that the CMake configure step will not succeed if the submodule is not present. The eva_py target should be triggered by a dependency from the python target which is included in the default build target.

Can you check whether your build output from make -j includes the following?

Scanning dependencies of target eva_py
[ 96%] Building CXX object python/eva/CMakeFiles/eva_py.dir/wrapper.cpp.o
[100%] Linking CXX shared module _eva.cpython-38-x86_64-linux-gnu.so
[100%] Built target eva_py

If not can you try running make eva_py?

Screenshot (323)
I tried make eva_py but this is what I got.

I think I figured out the cause of the problem, at least in my case: spaces in the path to EVA directory.

How did you fix it? Isn't the path automatically called?

I had EVA cloned in a folder with a path that contains a space, e.g., /home/bazzilic/my projects/EVA.
I moved it to /home/bazzilic/projects/EVA and it worked.

Makes sense now. Thanks!!

Should I clone SEAL into the EVA folder or should I clone it separately?
I installed the dependencies. Then for building EVA, i cloned EVA outside the SEAL folder and did the git submodule update and the steps below it.
I don't understand why I need to clone SEAL. Becoz I put SEAL and EVA in separate folders.
Am I doing it wrong?

I had the same issue today. I tried all what's listed above but it didn't solve the issue. Finally, I created a new python environment and installed python3.9.5 and it worked just smoothly. Previously I was using python3.7.10