AutoMihoyoBBS icon indicating copy to clipboard operation
AutoMihoyoBBS copied to clipboard

在阿里云函数计算报错

Open Sakuraers opened this issue 2 years ago • 8 comments

{ "errorMessage": "Unable to import module 'index'", "errorType": "ImportModuleError", "stackTrace": [ "ImportError: cannot import name 'asynccontextmanager'" ] }

Sakuraers avatar Aug 27 '22 12:08 Sakuraers

pip3 install PyYAML -t . 本地执行一遍后打包上传即可

Womsxd avatar Aug 27 '22 14:08 Womsxd

输入了然后出现这个pip3 install PyYAML -t . ERROR: Can not combine '--user' and '--target'

qingshenyue avatar Aug 28 '22 02:08 qingshenyue

输入了然后出现这个pip3 install PyYAML -t . ERROR: Can not combine '--user' and '--target'

在什么环境执行的?本地还是云函数,本地是在和main.py同一个目录吗?

Womsxd avatar Aug 28 '22 07:08 Womsxd

解决了,重新下载了一遍python

qingshenyue avatar Aug 28 '22 12:08 qingshenyue

image 我觉得挺离谱的

Sakuraers avatar Aug 30 '22 05:08 Sakuraers

同样这个问题,且pip3 install PyYAML -t .无效,python正常

TaoRone avatar Aug 31 '22 17:08 TaoRone

2022-09-01 01:34:46 f9209d94-bd3d-4224-9abe-a227933992ef [ERROR] {'errorMessage': "Unable to import module 'index'", 'errorType': 'ImportModuleError', 'stackTrace': ["ImportError: cannot import name 'asynccontextmanager'"]} FC Invoke End RequestId: f9209d94-bd3d-4224-9abe-a227933992ef, Error: Unhandled function error

TaoRone avatar Aug 31 '22 17:08 TaoRone

可以添加自定义依赖层

AetherKong avatar Sep 02 '22 02:09 AetherKong