1

Problem

I've been trying to build a fairly large python application into an executable for windows. I've done a mac build which works fine but I seem to be stuck loading in the _scrypt .pyd file that the scrypt module trys to load in at runtime.

__main__.PyInstallerImportError: Failed to load dynlib/dll 
'C:\\Users\\Chris\\Desktop\\Application\\dist\\test\\_scrypt.cp36- 
win_amd64.pyd'. Most probably this dynlib/dll was not found when the 
application was frozen.

I have tried the following:

  • Defining the scrypt .pyd file under binaries and hidden imports in my spec file. This works fine for all other files i need to add.

  • Using a runtime hook.

  • Using any other available python freeze application.

  • Editing the scrypts code.

  • Downloading up to SSL certificates 1.1.

  • Reinstalling microsoft .dlls i may be missing.

  • Reinstalling both the scrypt module and pycryptodome modules.

Running import scrypt into the python terminal gives meOSError: [WinError 126] The specified module could not be found, although strangely running the program i'm trying to build works until trying to use pyinstaller.

Relevant code in the scrypt module

import imp
import os
import sys

from ctypes import (cdll,
                    POINTER, pointer,
                    c_char_p,
                    c_size_t, c_double, c_int, c_uint64, c_uint32,
                    create_string_buffer)

__version__ = '0.8.6'

_scrypt = cdll.LoadLibrary(imp.find_module('_scrypt')[1])
#_scrypt = cdll.LoadLibrary("_scrypt.cp36-win_amd64.pyd")

Would really appreciate any advice where to go next, thank you.

poli
  • 11
  • 2
  • Is `_scrypt.cp36-win_amd64.pyd` in `C:\Users\Chris\Desktop\Application\dist\test\`? – l'L'l Aug 12 '18 at 06:01
  • Yeah, ```OSError: [WinError 126] The specified module could not be found``` i'm getting that when i try ```import scrypt``` into python terminal, although strangely running the program works without trying to build it with pyinstaller. – poli Aug 12 '18 at 06:23

0 Answers0