I'm trying to create an executable from another executable. When doing so, it appears the application is unable to pull the correct Python environment from the AppData paths. I've also struggled with attaching the additional files via the AppData path, but I was able to work around that by simply copying the files to a temporary directory first. I'm trying to avoid having end users set up and entire Python environment to run a simple application, but the application requires storing a unique login to access an API. If I run the application script in the same virtual environment I build it in, it runs without issue and I end up with my final executable exactly as I want it. I'm only having this issue when attempting to build the application from the first EXE. Another quirk: When I receive the error message, the application just...loops? I have code after that is never called. I've also wrapped the PyInstaller portion in a Try/Catch and that is never hit. The spec file is exactly what the list above it generates. save_path = 'C:/Users/' + getpass.getuser() pyinstaller_opts = [ tmp_folder + '/main.py', f"--add-data={tmp_folder + '/config.txt'}:.", f"--add-data={tmp_folder + '/avatar.png'}:.", '--onefile', '--noconsole', f'--icon={tmp_folder + "/deployments-reminder.ico"}', f'--distpath={save_path}', '--name', 'deployments-reminder', ] pyinstaller_opts = [ 'C:/Users/me/PycharmProjects/deployments-reminder-git/deployments-reminder.spec' ] print('pyinstaller ' + ' '.join(pyinstaller_opts)) input("Press Enter to continue...") try: print('okay') PyInstaller.__main__.run(pyinstaller_opts) print('oooookay?') except Exception: print(traceback.format_exc()) print("Unable to generate the EXE.") input("Press Enter to exit. ") sys.exit(1) print('not okay') print("") print("Done!") This might work as an example File 1 import os import PyInstaller import sys import shutil import tempfile tmp_folder = tempfile.gettempdir().replace(chr(92), '/') def resource_path(relative_path): try: base_path = sys._MEIPASS except Exception: base_path = os.path.abspath(".") return os.path.join(base_path, relative_path) def create_exe(): pyinstaller_opts = [ tmp_folder + '/step_2.py', '--name', 'hello_world' ] PyInstaller.__main__.run(pyinstaller_opts) if __name__ == '__main__': application = resource_path('step_2.py') shutil.copy(str(application), tmp_folder + '/step_2.py') create_exe() os.remove(tmp_folder + '/step_2.py') # compile with this # pyinstaller step_1.py -F --add-data=step_2.py:. -n test File 2 print('Hello, world!') Running the resulting exe from the first step does not result in a compiled exe of the second step. Continue reading...