Azure Web作业为python 3.6抛出错误“ImportError:没有名为enum的模块”

时间:2018-06-04 06:59:33

标签: python azure azure-webjobs

我有一个python脚本,我需要将其作为一个天蓝色的Web作业运行。我遵循了这些线程https://stackoverflow.com/questions/45716757/options-for-running-python-scripts-in-azure/45725327#45725327

但毕竟当我创建我的网络作业时,它的状态始终是“待重启”,当我检查日志时,它显示如下错误

[06/04/2018 06:50:29 > 22e0db: ERR ] ImportError: No module named enum
[06/04/2018 06:50:29 > 22e0db: SYS ERR ] Job failed due to exit code 1
[06/04/2018 06:50:29 > 22e0db: SYS INFO] Process went down, waiting for 60 seconds
[06/04/2018 06:50:29 > 22e0db: SYS INFO] Status changed to PendingRestart
[06/04/2018 06:51:30 > 22e0db: SYS INFO] Run script 'DataTransfer.py' with script host - 'PythonScriptHost'
[06/04/2018 06:51:30 > 22e0db: SYS INFO] Status changed to Running
[06/04/2018 06:51:30 > 22e0db: ERR ] Traceback (most recent call last):
[06/04/2018 06:51:30 > 22e0db: ERR ]   File "DataTransfer.py", line 1, in <module>
[06/04/2018 06:51:30 > 22e0db: ERR ]     from azure.storage.table import TableService, Entity
[06/04/2018 06:51:30 > 22e0db: ERR ]   File "D:\local\Temp\jobs\continuous\testwebjob\ffsxpauz.4rn\azure\storage\__init__.py", line 21, in <module>
[06/04/2018 06:51:30 > 22e0db: ERR ]     from .models import (
 [06/04/2018 06:51:30 > 22e0db: ERR ]   File "D:\local\Temp\jobs\continuous\testwebjob\ffsxpauz.4rn\azure\storage\models.py", line 27, in <module>
[06/04/2018 06:51:30 > 22e0db: ERR ]     from cryptography.hazmat.primitives.keywrap import(
[06/04/2018 06:51:30 > 22e0db: ERR ]   File "D:\local\Temp\jobs\continuous\testwebjob\ffsxpauz.4rn\cryptography\hazmat\primitives\keywrap.py", line 9, in <module>
[06/04/2018 06:51:30 > 22e0db: ERR ]     from cryptography.hazmat.primitives.ciphers import Cipher
[06/04/2018 06:51:30 > 22e0db: ERR ]   File "D:\local\Temp\jobs\continuous\testwebjob\ffsxpauz.4rn\cryptography\hazmat\primitives\ciphers\__init__.py", line 7, in <module>
[06/04/2018 06:51:30 > 22e0db: ERR ]     from cryptography.hazmat.primitives.ciphers.base import (
 [06/04/2018 06:51:30 > 22e0db: ERR ]   File "D:\local\Temp\jobs\continuous\testwebjob\ffsxpauz.4rn\cryptography\hazmat\primitives\ciphers\base.py", line 12, in <module>
[06/04/2018 06:51:30 > 22e0db: ERR ]     from cryptography.exceptions import (
 [06/04/2018 06:51:30 > 22e0db: ERR ]   File "D:\local\Temp\jobs\continuous\testwebjob\ffsxpauz.4rn\cryptography\exceptions.py", line 7, in <module>
[06/04/2018 06:51:30 > 22e0db: ERR ]     from enum import Enum
[06/04/2018 06:51:30 > 22e0db: ERR ] ImportError: No module named enum
[06/04/2018 06:51:30 > 22e0db: SYS ERR ] Job failed due to exit code 1
[06/04/2018 06:51:30 > 22e0db: SYS INFO] Process went down, waiting for 60 seconds
[06/04/2018 06:51:30 > 22e0db: SYS INFO] Status changed to PendingRestart

我的Python脚本是

from azure.storage.table import TableService, Entity
import json
import random
import string
from azure.servicebus import ServiceBusService, Message, Queue
def pullDataFromQueue():
bus_service = ServiceBusService(****)
msg = bus_service.receive_queue_message('myqueue', peek_lock=False)
print(msg.body)
return msg.body; 

0 个答案:

没有答案