Unable to access external files from exe converted python script

I wrote a code in python and converted it into an exe file using pyinstaller. It used to access 2 external csv files(they were in the same folder) that it can no longer access. This is the error message I get:

Traceback (most recent call last):

File "tkinter/_init.py", line 1885, in __call_
  File "testing.py", line 145, in calculate_op
  FileNotFoundError: [Errno 2] No such file or directory: 'input_data_ss.csv'  

line 145 is:

with open('input_data_ss.csv', mode ='r') as file:
        csvFile = csv.reader(file)


Read more here: https://stackoverflow.com/questions/68462199/unable-to-access-external-files-from-exe-converted-python-script

Content Attribution

This content was originally published by bhavya at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: