I'm trying to build an exe with this script:
from pandas import read_csv
def csv_parser(path):
a = read_csv(path, header=0, sep=";")
return a
volume_surfarea_table = csv_parser(R"GURPS Vehicles Calc\Tables\Volume Area Table.csv")
component_dr_table = csv_parser(R"GURPS Vehicles Calc\Tables\Components DR Table.csv")
def get_CF():
vsp = float(input("What's the VSP? "))
cf = vsp/5
rowN = 0
for x in range(64):
if cf <= volume_surfarea_table.iloc[rowN,0]:
hit_points = volume_surfarea_table.iloc[rowN,1]
break
rowN = rowN + 1
return hit_points
def get_DR():
compo_type = input("What's the component type? ")
compo_type = compo_type.title()
rowN = 0
for x in range(6):
if compo_type in component_dr_table.iloc[rowN,0]:
compoDR = component_dr_table.iloc[rowN,1]
break
rowN = rowN + 1
return compoDR
finished = "false"
while finished == "false":
hit_points = get_CF()
compoDR = get_DR()
compo_stats = f"""Your component has {hit_points}HP and a DR of {compoDR}."""
print(compo_stats)
done = input("Are you finished? (y/n) ")
if done == "y":
finished = "true"
Here's what I use on prompt:
pyinstaller -F --add-data "Tables\Volume Area Table.csv;GURPS Vehicles Calc\Tables" --add-data "Tables\Components DR Table.csv;GURPS Vehicles Calc\Tables" "Vehicles Calc.py"
The building process works fine, but whenever I try to run the exe, it gives me this error:
Traceback (most recent call last):
File "Vehicles Calc.py", line 7, in <module>
File "Vehicles Calc.py", line 4, in csv_parser
File "pandas\util\_decorators.py", line 311, in wrapper
File "pandas\io\parsers\readers.py", line 586, in read_csv
File "pandas\io\parsers\readers.py", line 482, in _read
File "pandas\io\parsers\readers.py", line 811, in __init__
File "pandas\io\parsers\readers.py", line 1040, in _make_engine
File "pandas\io\parsers\c_parser_wrapper.py", line 51, in __init__
File "pandas\io\parsers\base_parser.py", line 222, in _open_handles
File "pandas\io\common.py", line 701, in get_handle
FileNotFoundError: [Errno 2] No such file or directory: 'Volume Area Table.csv'
[16192] Failed to execute script 'Vehicles Calc' due to unhandled exception!
What am I doing wrong? I've checked the documentation and a bunch of other stuff, but I can't build an exe that works.