goncalovalverde / seshat

MIT License
1 stars 0 forks source link

File not found error, if CSV file configured! #7

Open paulojaraujo opened 3 years ago

paulojaraujo commented 3 years ago

2020-12-21 18:15:37,854 - root - DEBUG - - Reading data for CSV example Traceback (most recent call last): File "./seshat.py", line 24, in data = reader.read_data(source_config) File "/home/oluapojuara/seshat-master/reader/init.py", line 18, in read_data cycle_data = reader.csv.read(config["csv"], config["Workflow"]) File "/home/oluapojuara/seshat-master/reader/csv.py", line 10, in read cycle_data = pd.read_csv(csv_file) File "/home/oluapojuara/.local/lib/python3.8/site-packages/pandas/io/parsers.py", line 688, in read_csv return _read(filepath_or_buffer, kwds) File "/home/oluapojuara/.local/lib/python3.8/site-packages/pandas/io/parsers.py", line 454, in _read parser = TextFileReader(fp_or_buf, kwds) File "/home/oluapojuara/.local/lib/python3.8/site-packages/pandas/io/parsers.py", line 948, in init self._make_engine(self.engine) File "/home/oluapojuara/.local/lib/python3.8/site-packages/pandas/io/parsers.py", line 1180, in _make_engine self._engine = CParserWrapper(self.f, self.options) File "/home/oluapojuara/.local/lib/python3.8/site-packages/pandas/io/parsers.py", line 2010, in init self._reader = parsers.TextReader(src, kwds) 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: 'safaricom_csv.csv'**

oluapojuara@oluapojuara-Virtual-Machine:~/seshat-master/conf/Celfocus$ ll total 36 drwxrwxr-x 2 oluapojuara oluapojuara 4096 dez 22 13:08 ./ drwxrwxr-x 3 oluapojuara oluapojuara 4096 dez 21 18:25 ../ -rw-rw-r-- 1 oluapojuara oluapojuara 16273 dez 21 13:05 safaricom_csv.csv -rw-rw-r-- 1 oluapojuara oluapojuara 241 dez 21 19:34 safaricom_csv.yml-example

oluapojuara@oluapojuara-Virtual-Machine:~/seshat-master/conf/Celfocus$

Is this teh correct location?

goncalovalverde commented 3 years ago

The "file:" configuration is to pass the name and path to the file. If no path is given then it assumes that the file is on the base directory of the application. On your case if you put the file in ~/seshat-master it should work Or you can configure like this: file: conf/Celfocus/safaricom_csv.csv

That should do the trick

I'll update the configuration file to make this more clear