Python 3.x ModuleNotFoundError:没有名为';apscheduler';使用python3时
使用此命令启动项目时:Python 3.x ModuleNotFoundError:没有名为';apscheduler';使用python3时,python-3.x,Python 3.x,使用此命令启动项目时: ~/source/pydolphin on master! ⌚ 15:52:02 $ python3.9 schedulespider.py ‹ruby-2.7.2› Traceback (most recent call last): File "/Users/dolphin/source/pydolphin
~/source/pydolphin on master! ⌚ 15:52:02
$ python3.9 schedulespider.py ‹ruby-2.7.2›
Traceback (most recent call last):
File "/Users/dolphin/source/pydolphin/schedulespider.py", line 4, in <module>
from apscheduler.schedulers.background import BackgroundScheduler
ModuleNotFoundError: No module named 'apscheduler'
(base)
但问题仍然存在,我应该怎么做才能解决它?这是我的Python代码:
# coding=utf-8
import time
from apscheduler.schedulers.background import BackgroundScheduler
from dolphin.biz.RssEntry import RssEntry
if __name__ == '__main__':
scheduler = BackgroundScheduler()
rss = RssEntry()
scheduler.add_job(rss.rss_sub, 'cron', minute='*/1', max_instances=10)
scheduler.start()
try:
while True:
time.sleep(20)
except (KeyboardInterrupt, SystemExit):
scheduler.shutdown()
# coding=utf-8
import time
from apscheduler.schedulers.background import BackgroundScheduler
from dolphin.biz.RssEntry import RssEntry
if __name__ == '__main__':
scheduler = BackgroundScheduler()
rss = RssEntry()
scheduler.add_job(rss.rss_sub, 'cron', minute='*/1', max_instances=10)
scheduler.start()
try:
while True:
time.sleep(20)
except (KeyboardInterrupt, SystemExit):
scheduler.shutdown()