运行Azure ServiceBus的python脚本时出现此错误。
文件位置错误,还是导入错误?
pi@raspberrypi:~/letsroll $ python mrrobot.py
Traceback (most recent call last):
File "mrrobot.py", line 6, in <module>
from azure.servicebus import ServiceBusService
ImportError: No module named servicebus
Azure SDK路径: pi@raspberrypi:~/azure-sdk-for-python $
Python脚本路径:
pi@raspberrypi:~/letsroll $ ls
mrrobot.py
mrrobot.py
import RPi.GPIO as GPIO #For Controlling the Pins
import threading #To Run On Thread
import sys
import select
from azure.servicebus import ServiceBusService
import os
# Make sure you set the following:
AZURE_SERVICEBUS_NAMESPACE='mrrobot' #Your NameSpace Should Go Here
# Note: this user should have manage rights
AZURE_SERVICEBUS_SHARED_KEY_NAME='RootManageSharedAccessKey'
AZURE_SERVICEBUS_ACCESS_KEY_VALUE='MpcCdemokey'
GPIO_BCM_PIN = 17 #Pin your LED is connected to
答案 0 :(得分:1)
您的Python解释器未找到包。这可能有以下几个原因:
lapply
文件夹的内容,我无法分辨。如果手动安装代码,请不要忘记依赖项。