How to Solve NameError: name 'collect_data_files' is not defined -- PyInstaller

Solution: Import the 'collect_data_files' module

To Solve the error, add the following line to the top of your code.

from PyInstaller.utils.hooks import collect_data_files

 

For more information:
Python PyInstaller collect_data_files