Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RuntimeError: cannot schedule new futures after interpreter shutdown

I'm programming a python robot in the telegram, but I have an error that is not resolved, the error is in the schedule

Traceback (most recent call last):
  File "C:\Users\vini6\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\apscheduler\schedulers\base.py", line 979, in _process_jobs
    executor.submit_job(job, run_times)
  File "C:\Users\vini6\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\apscheduler\executors\base.py", line 71, in submit_job
    self._do_submit_job(job, run_times)
  File "C:\Users\vini6\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\apscheduler\executors\pool.py", line 28, in _do_submit_job
    f = self._pool.submit(run_job, job, job._jobstore_alias, run_times, self._logger.name)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.2544.0_x64__qbz5n2kfra8p0\lib\concurrent\futures\thread.py", line 169, in submit
    raise RuntimeError('cannot schedule new futures after '
RuntimeError: cannot schedule new futures after interpreter shutdown
like image 275
Vinicius Eduardo Avatar asked Mar 20 '26 21:03

Vinicius Eduardo


2 Answers

In case you are using python-telegram-bot, you might be missing an updater.idle() call after updater.start_polling()

I reported a bug here, and got this solution as a reply, which fixed it for me. I had the very same error message, although it is a different package here. So leaving this for folks that come here, after searching for the above error message.

like image 103
anarchist912 Avatar answered Mar 22 '26 10:03

anarchist912


It's bug or something of python 3.9.9. I also came across this issue. But it works well on python 3.7 and python 3.8. Not sure if any other python3.9.x works

Update on 2022/02/11, this issue exists from python3.9 to python 3.10

like image 37
Carl Cheung Avatar answered Mar 22 '26 09:03

Carl Cheung



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!