Nuitka: Cannot get cryptodome module to work

Hello Kay,

I am trying to compile a program that uses pycryptodome module as standalone, and of course running into issues. I’ve tried with latest nuitka stable and latest rc so far, and tried to find some topics before opening the issue.

  • Nuitka version, full Python version and Platform (Windows, OSX, Linux …) 0.6.2rc1 Python: 3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 14:05:16) [MSC v.1915 32 bit (Intel)] Executable: C:\Python37-32\python.exe OS: Windows Arch: x86

Using MingW64 8.1.0 with posix/dwarf

  • How did you install Nuitka and Python (pip, anaconda, deb, rpm, from source, what is a virtualenv …), this is very important usually. Installed latest nuitka as site package with http://nuitka.net/releases/Nuitka-6.0.210.win32.py37.msi By the way, there seems to be a naming problem with those 6.0.210 develop packages which naming make them look elder than the 6.1.10 stable packages.

  • If possible please supply a Short, Self Contained, Correct, Example Example test.py file:

from Crypto.Cipher import AES
from Crypto.Random import get_random_bytes

print(str(get_random_bytes(1337)))

Compiled with

python -m nuitka --exe --follow-imports --recurse-to=Crypto --standalone c:\PythonApps\test\test.py

Compilation produces no errors.

  • If this is a regression (used to work in an earlier version of Nuitka), Didn’t find anything about this.

Anything I may have missed ? Best regards.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 46 (43 by maintainers)

Commits related to this issue

Most upvoted comments

After doing git pull; git checkout develop, I didn’t redo git pull, hence I didn’t find the changes. Thanks. I’ll see to add support for both packages.

@BoboTiG I think I only ever did anything for cryptodomex, and mean to still look at cryptodome when I find the time.

I have just pushed to the factory branch changes that will enable standalone for cryptodomex and Python3, just what @BoboTiG wants.

The ugly thing is this uses the method to locate Python extension modules, and not the one to find DLLs, as “.pyd” files won’t match. This is a CFFI issue. I think I want to make it a better named helper function of some sorts, to include things.

I also found that the task of adding extra DLLs is a bit strange. You get to make the copy and report what you did, and then other things work on the DLL. But why do I have to shutit.copy myself, I think the plugin layer ought to do that.

I also added a method to the plugins to decide a module kind and name from a filename, just for CFFI here, and because it’s otherwise a cyclic dependency for every user. Not sure how useful that is in the long run. And maybe, when searching concrete DLL, we can rather than listdir, just create the allowed filenames from what we know instead of matching.

So this is under heavy flux still. But try it out as described under: http://nuitka.net/doc/factory.html

Before I make too many cleanups though, I want to cover Python2 as well, and normal cryptodome, which ought to be easy now, as @deajan says.

@BoboTiG I was so side tracked yesterday, it’s not funny. But I will get to it. 😃

Ok, will look into it later today, with the information already provided by @deajan this ought to be doable for me.