pqcrypto icon indicating copy to clipboard operation
pqcrypto copied to clipboard

Module doesn't exist

Open therealOri opened this issue 1 year ago • 8 comments

I Pip installed the package, imported like what's showing for the examples, tried to run and I get the following error.

Traceback (most recent call last):
  File "/home/ori/Desktop/playground/latty/latty.py", line 1, in <module>
    from pqcrypto.kem.kyber1024_90s import generate_keypair, encrypt, decrypt
  File "/home/ori/Desktop/playground/latty/pqlENV/lib/python3.10/site-packages/pqcrypto/kem/kyber1024_90s.py", line 1, in <module>
    from .._kem.kyber1024_90s import ffi as __ffi, lib as __lib
ModuleNotFoundError: No module named 'pqcrypto._kem.kyber1024_90s'

Anything in the _kem directory is not there. It's empty. (Except for the very empty .gitkeep file)

therealOri avatar Mar 23 '23 16:03 therealOri

TLDR: execute compile.py in the source code before pip installing pqcrypto. The instructions as is are incomplete.

I don't really have anything to do with this repository, but I found a main statement in compile.py of this source code that would build/compile the project, but that isn't seem to be invoked in the poetry build process nor specified in procedure outlined on the project's main page. It might look something like the following given the build code's current state:

Using poetry

pip install poetry python compile.py poetry build

ttinies avatar Mar 31 '23 17:03 ttinies

Even after following your steps it doesn't work. Same error still. Can you help me please? _kem directory is now not empty but still cannot reference it in python script.

Erebus9456 avatar Jul 09 '23 19:07 Erebus9456

I tried and succeeded thanks

longh30kma avatar Sep 06 '23 17:09 longh30kma

@Erebus9456 ok , this is how to fix this error after installing using pip 1- download the source code 2- cd into the source code directory 3- sudo python3 compile.py (may take a while to compile) , this will create a _kem directory in ./pqcrypto/ 4- go to the package directory downloaded by pip , usually in /home/$USER/.local/lib/python3.11/site-packages/pqcrypto 5- create a init.py file in kem directory 6- remove _kem directory 7- cp _kem from compiled source code into the downloaded package by pip

neomn avatar Oct 15 '23 13:10 neomn

Hi everyone, maintainer here. I believe this cluster of issues is due to a regression in Poetry, it no longer seems to respect tool.poetry.build. I'll look into it soon.

kpdemetriou avatar Oct 15 '23 14:10 kpdemetriou

@kpdemetriou that would be great, thanks

neomn avatar Oct 15 '23 15:10 neomn

Mình đã thử và thành công thanks

help me

Duongguyen avatar Nov 20 '23 17:11 Duongguyen

@Duongguyen Checkout my package , is very simple and easy to use

neomn avatar Nov 20 '23 17:11 neomn