Forums

Python script freezes

I have a Python script that runs on my own machine, but when I try to run on PythonAnywhere, I get this log:

 02:26 ~/marketplaceScraper (master)$ python3 facebooklive.py 
/home/AmmarKhawaja/.local/lib/python3.10/site-packages/pandas/core/computation/expressions.py:21: UserWarning: Pandas requires version '2.8.4' or newer of 'nu
mexpr' (version '2.8.1' currently installed).
  from pandas.core.computation.check import NUMEXPR_INSTALLED

The script then freezes.

[formatted by admin]

It looks like you need to install newer version of numexpr package.

Tried doing that still getting the same error. Also got an email that my processes are in the tarpit, could this be a reason?

Actually, could you show the full error? The thing you showed above is only a UserWarning, so that is not necessarily the main issue.

Ok I believe the issue is with writing to a csv file.

The script seems frozen and when I Ctrl+C to exit, I get this error, so I'm assuming it is erroring on the write operation. But its not giving any useful feedback so not sure what the issue is. I have tried deleting and recreating the file:

^CTraceback (most recent call last): File "<stdin>", line 1, in <module> File "/bin/pythonanywhere_runner.py", line 30, in _pa_run exec(code, new_variables) File "/home/AmmarKhawaja/marketplaceScraper/facebooklive.py", line 281, in <module> main() File "/home/AmmarKhawaja/marketplaceScraper/facebooklive.py", line 268, in main run_program([0,1]) File "/home/AmmarKhawaja/marketplaceScraper/facebooklive.py", line 263, in run_program with open(file_prefix + 'error_log.txt', 'a', encoding='utf-8') as t: KeyboardInterrupt

Figured it out.. issue was with a while loop having some unexpected behavior

Glad you figured that out!