I'm trying to convert my python code "new.py" to an exe using pyinstaller. The exe got built successfully but when I try to run it it shows me the following error:
$ /Users/name/Desktop/Programming\ Projects/PythonWebscraper/dist/new ; exit;
Traceback (most recent call last):
File "new.py", line 37, in <module>
File "openpyxl/reader/excel.py", line 151, in load_workbook
File "openpyxl/reader/excel.py", line 115, in _validate_archive
File "zipfile.py", line 1240, in __init__
FileNotFoundError: [Errno 2] No such file or directory: './PulledData.xlsx'
[78053] Failed to execute script new
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.
My code is writing to an excel spread sheet and so it's loading up the file './PulledData.xlsx'. I put the excel sheet in the same directory as the exe that I'm tryin to run, yet it still can't find the excel sheet as shown by the logs. (new.exe and PulledData.xlsx are both in the same directory)
How do I fix this? Is this something to do with Pyinstaller? I don't want to bundle up the excel sheet as it should be easy to access. The exe (python code) should manipulate the excel sheet called "PulledData" in whatever directory its in, how can I do that?