尝试为raspberry pi-xbee home automation运行python脚本:
from xbee import zigbee
from apscheduler.scheduler import Scheduler
import time
import serial
import Queue
我的具体问题是从apscheduler导入:
^{pr2}$这通常是1)导入名称中的大小写错误,2)未安装库,或3)库的版本错误。例如,解释器抱怨zigbee导入,因为原始脚本将其大写。在
更大的问题是,一旦安装了python库(在本例中是apscheduler),如何判断哪些导入是可用的,而不是在python脚本中重复猜测?是否有一个python命令列出已安装的库、它们的版本和可用的导入?在
正如@josebama提到的,它是
apscheduler.schedulers
,您可以查看一下所有模块here。在关于检查库是否已安装,只需从命令行运行
python
,然后尝试使用import apscheduler
导入库。在该脚本是为APScheduler的pre-3.xapi编写的。因此,要么安装早期版本的APScheduler,要么修复脚本以使用较新的API。在
相关问题 更多 >
编程相关推荐