Pyinstaller "Failed to execute script pyi_rth_pkgres" and missing packages : <p>This is my first time posting a question here as most of my questions have already been answered by someone else!  I am working on a GUI application in python and am attempting to use pyinstaller to package it into a single folder and .exe for easier portability.  Currently, I am using windows 10 and anaconda3 to manage my python packages.  The application relies on tkinter, pillow, numpy, scikit-learn, opencv, ffmpeg, and matplotlib.  The application is formatted with a main GUI.py file that creates objects of a number of other files (many of which are stored in a subfolder as this GUI is replacing a command line utility that served the same purpose).  The issue I am running into (as you can see in the title) is that the .exe is throwing the error block:</p>

<blockquote>
  <p>Traceback (most recent call last):
    File "site-packages\PyInstaller\loader\rthooks\pyi_rth_pkgres.py", line 11, in 
    File "c:\users\gurnben\anaconda3\envs\opencv\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 389, in load_module
      exec(bytecode, module.<strong>dict</strong>)
    File "site-packages\setuptools-20.7.0-py3.5.egg\pkg_resources__init__.py", line 68, in 
    File "site-packages\setuptools-20.7.0-py3.5.egg\pkg_resources\extern__init__.py", line 60, in load_module
  ImportError: The 'packaging' package is required; normally this is bundled with this package so if you get this warning, consult the packager of your distribution.
  Failed to execute script pyi_rth_pkgres</p>
</blockquote>

<p>When I look at the warn.txt it gives a massive list of missing packages including parts of some packages that are actually in the single folder package.<br>
I have, however, successfully gotten it to recognize the dll files from opencv and it is not listed among the missing (nor is ffmpeg however I did not see any ffmpeg files in the folder).  I had to pass in a custom path to get it to include the opencv files as they are not in anaconda at this time.  </p>

<p>Any hints or ideas for next troubleshooting steps?  I am overly greatful for all of the help you an offer and I can upload any code, files, etc. that would help you diagnose the issue.  In the meantime I will continue searching for a solution myself!</p>
