I have been trying to bundle a json file in a python executable created with pyinstaller. After a lot of researching, the solution I found involved making use of the _MEIPASS folder; however, VSCode claims that the sys package has no _MEIPASS member.
The relevant part of my code goes like this:
branches_path = 'bank_branches/bank_branches.json'
if hasattr(sys, "_MEIPASS"):
branches_path = os.path.join(sys._MEIPASS, branches_path)
The code works on the terminal version, as well as on the standalone application, so this is taken care of; however, I'd like to know if there is a solution which works and has no errors associated. If it helps, I'm using Python 3.6.6