1

Pyinstaller failed to find certain dlls that are required for binding in dependencies into one exe.

Please find the error logs below.

We have tried installing these libraries:

pip3 install intel-openmp mkl

Tried adding --paths to the command, but as there are no dlls in the system, pyinstaller is unable to find them:

pyinstaller --onefile --paths <Paths-where-dll-could-be> -c main.py

These libs are missing and showed in logs as WARNINGS.

364427 WARNING: lib not found: impi.dll dependency of c:\users\1311654\appdata\local\programs\python\python36\Library\bin\mkl_blacs_intelmpi_ilp64.dll
365396 WARNING: lib not found: mpich2mpi.dll dependency of c:\users\1311654\appdata\local\programs\python\python36\Library\bin\mkl_blacs_mpich2_lp64.dll
366241 WARNING: lib not found: msmpi.dll dependency of c:\users\1311654\appdata\local\programs\python\python36\Library\bin\mkl_blacs_msmpi_lp64.dll
368089 WARNING: lib not found: msmpi.dll dependency of c:\users\1311654\appdata\local\programs\python\python36\Library\bin\mkl_blacs_msmpi_ilp64.dll
369270 WARNING: lib not found: pgf90.dll dependency of c:\users\1311654\appdata\local\programs\python\python36\Library\bin\mkl_pgi_thread.dll
369997 WARNING: lib not found: pgc14.dll dependency of c:\users\1311654\appdata\local\programs\python\python36\Library\bin\mkl_pgi_thread.dll
370791 WARNING: lib not found: pgf90rtl.dll dependency of c:\users\1311654\appdata\local\programs\python\python36\Library\bin\mkl_pgi_thread.dll
373039 WARNING: lib not found: mpich2mpi.dll dependency of c:\users\1311654\appdata\local\programs\python\python36\Library\bin\mkl_blacs_mpich2_ilp64.dll
374289 WARNING: lib not found: impi.dll dependency of c:\users\1311654\appdata\local\programs\python\python36\Library\bin\mkl_blacs_intelmpi_lp64.dll
377030 WARNING: lib not found: torch_python.dll dependency of c:\users\1311654\appdata\local\programs\python\python36\lib\site-packages\torch\_C.cp36-win_amd64.pyd
378792 WARNING: lib not found: c10_cuda.dll dependency of c:\users\1311654\appdata\local\programs\python\python36\lib\site-packages\torchvision\_C.cp36-win_amd64.pyd
379568 WARNING: lib not found: torch.dll dependency of c:\users\1311654\appdata\local\programs\python\python36\lib\site-packages\torchvision\_C.cp36-win_amd64.pyd
380290 WARNING: lib not found: caffe2.dll dependency of c:\users\1311654\appdata\local\programs\python\python36\lib\site-packages\torchvision\_C.cp36-win_amd64.pyd
381126 WARNING: lib not found: c10.dll dependency of c:\users\1311654\appdata\local\programs\python\python36\lib\site-packages\torchvision\_C.cp36-win_amd64.pyd
382053 WARNING: lib not found: torch_python.dll dependency of c:\users\1311654\appdata\local\programs\python\python36\lib\site-packages\torchvision\_C.cp36-win_amd64.pyd

As the missing lib dlls are not in the system, kindly assist the efficient way to build the exe.

2 Answers2

3

Your log of warnings is very similar to mine: PyInstaller .exe file terminates early without an error message

I am therefore assuming, despite these warnings, PyInstaller still successfully builds your executable? These steps (as per above link) worked for me:

  1. Use PyInstaller to generate a one-folder bundle.
  2. From within your python environment that you used to write your program, search for all "dll" files, and copy & paste them into the dist folder of your bundle.
  3. In my case, this enabled my executable file to run successfully.
  4. You can then experiment by systematically removing the DLL files you pasted into your dist folder, in order to identify which are essential and which are redundant.
  5. (optional) if you prefer a one-file bundle, you will need to do step 4 to identify the essential DLL files that are required for your executable file to run, so that you can add just these DLLs as data files to your one-file build (in my case, it was just the one! - "libiomp5md.dll").

Appreciate this is not a very elegant solution, it's more about perseverance! Good luck :)

jmoyes
  • 181
  • 9
1

Windows searches for DLLs in the following locations (I may not have the order right):

-Current directory

-Directory containing the EXE that asked for the DLL (directly or indirectly)

-Directories in PATH

-Windows directory

-Windows System directory

  1. If you have Visual Studio installed on your computer, use dumpbin to figure out what your DLL depends on. (dumpbin is installed here C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\dumpbin.exe)

dumpbin /DEPENDENTS your.dll

this will list the DLLs dependencies. Make sure they are included in the same directory as your exe.

  1. If you don't have Visual Studio or dumpbin, download http://www.dependencywalker.com/ and it will accomplish the same thing

  2. Make sure you have the most recent version of pyinstaller as well.

Hope this helps.

  • But for the dumpbin we need a .dll to know what are the required dependencies, but after running Pyinstaller, i am getting an .exe out of it and no major .dll file onto which i can run dumpbin command. Hope I made myself clear for the doubt I had – BISWAJIT SAHOO Sep 19 '19 at 08:39