In my python file, the "df = pd.read_csv('table.csv')" bit causes a FileNotFoundError even though it resides in the same directory. I run my executable file that I built with pyinstaller.
import tkinter as tk
import pandas as pd
df = pd.read_csv('table.csv')
When I attempt to build the exe with pyinstaller I use the following code in terminal:
pyinstaller --onefile --add-data 'table.csv:.' gui_calc.py
When I run the executable file...
Traceback (most recent call last):
File "gui_calc.py", line 9, in <module>
File "pandas/io/parsers.py", line 686, in read_csv
File "pandas/io/parsers.py", line 452, in _read
File "pandas/io/parsers.py", line 936, in __init__
File "pandas/io/parsers.py", line 1168, in _make_engine
File "pandas/io/parsers.py", line 1998, in __init__
File "pandas/_libs/parsers.pyx", line 382, in pandas._libs.parsers.TextReader.__cinit__
File "pandas/_libs/parsers.pyx", line 674, in pandas._libs.parsers.TextReader._setup_parser_source
FileNotFoundError: [Errno 2] No such file or directory: 'table.csv'
[58900] Failed to execute script gui_calc
[Process completed]
My environment is:
Mac OSX 10.15.6
Python 3.7.7
pandas Version: 1.1.1
zsh 5.7.1
pyinstaller Version: 4.1.dev0