从已安装的程序包导入类时出错
我已经安装并重新安装了lazylights 我已将导入更改为整个库,但是出现错误:创建类实例时未定义Lifx
from lazylights import Lifx
import time
lifx = Lifx(num_bulbs=1) # so it knows how many to wait for when connecting
@lifx.on_connected
def _connected():
print "Connected!"
这将产生:
ImportError: cannot import name Lifx