Pyinstaller unable to find dlls for the project dependencies while creating exe
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 &lt;Paths-where-dll-could-be&gt; -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.

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:

Use PyInstaller to generate a one-folder bundle.
From within your python environment that you used to write your program, search for all &quot;dll&quot; files, and copy &amp; paste them into the dist folder of your bundle.
In my case, this enabled my executable file to run successfully.
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.
(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! - &quot;libiomp5md.dll&quot;).

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