问题报错:
PytzUsageWarning: The zone attribute is specific to pytz's interface; please migrate to a new time zone provider.
For more details on how to do so, see https://pytz-deprecation-shim.readthedocs.io/en/latest/migration.html
PytzUsageWarning: The localize method is no longer necessary, as this time zone supports the fold attribute (PEP 495)
解决:
from apscheduler.schedulers.background import BackgroundScheduler
sched = BackgroundScheduler(timezone='Asia/Shanghai')