FileNotFoundError: [Errno 2] No such file or directory: '/var/folders/mf/m76x8ty92_s62ly5dyfrmhm80000gn/T/_MEIOZO6HY/Config.json'
I don't understand why it is looking for this path.
Could you help me please ?
You need to read up on what --onefile actually does to understand why it’s looking in such an obscure corner of your PC.
PyInstaller doesn’t collect data files by default - you need to use the --add-data option to explicitly add each one (note the very specific syntax --add-data=./Config.json:.). You also should read up on using __file__ to locate data files at run time. Your code would break even without PyInstaller if you ran it from a different directory. Once you’ve done that you can then see the docs for using __file__ in PyInstaller.