Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

app: referenced CSV files inexistent #24

Open
TAnas0 opened this issue Jul 2, 2022 · 0 comments
Open

app: referenced CSV files inexistent #24

TAnas0 opened this issue Jul 2, 2022 · 0 comments

Comments

@TAnas0
Copy link

TAnas0 commented Jul 2, 2022

Two CSV files are being referenced in src/app/app.py and I have no clue what they should be: https://github.com/WarrierRajeev/UFC-Predictions/blob/master/src/app/app.py#L22

I have successfully scraped all data running python -m src.create_ufc_data. I get the following files:

UFC-Predictions/data$ tree .
.
├── data.csv
├── event_and_fight_links.pickle
├── past_event_links.pickle
├── past_fighter_links.pickle
├── preprocessed_data.csv
├── raw_fighter_details.csv
├── raw_total_fight_data.csv
└── scraped_fighter_data_dict.pickle

0 directories, 8 files

Next, I tried running the web app using it's Dockerfile:

docker build -t ufc/ufc-predictions .
docker run --env PORT=8765 ufc/ufc

I get an error message which ends with:

[2022-07-02 17:47:39 +0000] [10] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/gunicorn/arbiter.py", line 589, in spawn_worker
    worker.init_process()
  File "/usr/local/lib/python3.6/site-packages/gunicorn/workers/base.py", line 134, in init_process
    self.load_wsgi()
  File "/usr/local/lib/python3.6/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi
    self.wsgi = self.app.wsgi()
  File "/usr/local/lib/python3.6/site-packages/gunicorn/app/base.py", line 67, in wsgi
    self.callable = self.load()
  File "/usr/local/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 58, in load
    return self.load_wsgiapp()
  File "/usr/local/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp
    return util.import_app(self.app_uri)
  File "/usr/local/lib/python3.6/site-packages/gunicorn/util.py", line 359, in import_app
    mod = importlib.import_module(module)
  File "/usr/local/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/app/app.py", line 22, in <module>
    fighter_df = pd.read_csv("app_data/latest_fighter_stats.csv", index_col="index")
  File "/usr/local/lib/python3.6/site-packages/pandas/io/parsers.py", line 688, in read_csv
    return _read(filepath_or_buffer, kwds)
  File "/usr/local/lib/python3.6/site-packages/pandas/io/parsers.py", line 454, in _read
    parser = TextFileReader(fp_or_buf, **kwds)
  File "/usr/local/lib/python3.6/site-packages/pandas/io/parsers.py", line 948, in __init__
    self._make_engine(self.engine)
  File "/usr/local/lib/python3.6/site-packages/pandas/io/parsers.py", line 1180, in _make_engine
    self._engine = CParserWrapper(self.f, **self.options)
  File "/usr/local/lib/python3.6/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: 'app_data/latest_fighter_stats.csv'
[2022-07-02 17:47:39 +0000] [10] [INFO] Worker exiting (pid: 10)
[2022-07-02 17:47:39 +0000] [7] [INFO] Shutting down: Master
[2022-07-02 17:47:39 +0000] [7] [INFO] Reason: Worker failed to boot.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant