Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module doesn't exist #10

Open
therealOri opened this issue Mar 23, 2023 · 8 comments
Open

Module doesn't exist #10

therealOri opened this issue Mar 23, 2023 · 8 comments

Comments

@therealOri
Copy link

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)

@ttinies
Copy link

ttinies commented Mar 31, 2023

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

@Erebus9456
Copy link

Erebus9456 commented Jul 9, 2023

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.

@longh30kma
Copy link

I tried and succeeded thanks

@neomn
Copy link

neomn commented Oct 15, 2023

@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

@kpdemetriou
Copy link
Owner

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.

@neomn
Copy link

neomn commented Oct 15, 2023

@kpdemetriou
that would be great, thanks

@Duongguyen
Copy link

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

help me

@neomn
Copy link

neomn commented Nov 20, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants