这可能是一个愚蠢的问题。
我不知道我为什么要面对ModuleNotFoundError: No module named 'apscheduler'
,但我已经成功安装了 APscheduler。
我已经尝试卸载它并重新安装特定版本的APscheduler,但它没有工作。我也尝试在 virtualenv 上安装它,但效果不佳。
蟒蛇:| 点数:20.3.3 | 版本:3.7.3 操作系统:Linux (Ubuntu 20.04)
from __future__ import absolute_import
import octoprint.plugin
from apscheduler.schedulers.background import BackgroundScheduler
from influxdb_client import InfluxDBClient, Point
import requests
def __init__(self):
super().__init__()
self.backgroundScheduler = BackgroundScheduler()
记录如下:
Traceback (most recent call last):
File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/plugin/core.py", line 1298, in _import_plugin
module = _load_module(module_name, spec)
File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/plugin/core.py", line 69, in _load_module
return imp.load_module(name, f, filename, details)
File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/vendor/imp.py", line 238, in load_module
return load_package(name, filename)
File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/vendor/imp.py", line 212, in load_package
return _load(spec)
File "<frozen importlib._bootstrap>", line 696, in _load
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/home/pi/oprint/lib/python3.7/site-packages/octoprint_CMfgDataAcquisition/__init__.py", line 13, in <module>
from apscheduler.schedulers.background import BackgroundScheduler
ModuleNotFoundError: No module named 'apscheduler'
APscheduler == 3.6.3 已安装。