我在VS代码(Windows)上使用了Python.我遇到以下错误:
Traceback (most recent call last):
File "c:\Users\taimo\Documents\Visual Studio Code Workloads\Python VS Code\DateTimeModule.py", line 1, in <module>
import schedule
ModuleNotFoundError: No module named 'schedule'
我try 了许多方法来解决这个问题,包括在VS代码中更改Python解释器,在我的计算机上更新Python版本,使用PIP3安装"Scheduler",使用PIP3卸载并重新安装Scheduler,然而即使在所有这些之后,问题也没有得到修复.
这是令人气愤的,因为几天前,它还运行得很好,没有任何错误,而今天它突然开始抛出这个错误.如果你能帮我解决这个问题,我将不胜感激.
提前谢谢!
我正在运行的代码是:
import schedule
import time
def job():
print("I'm working...")
schedule.every(10).seconds.do(job)
while True:
schedule.run_pending()
time.sleep(1)