Mcreeper 发表于 2022-1-29 21:31

腾讯云函数报错

Result: {"errorCode": -1, "errorMessage": "Traceback (most recent call last):   File "/var/runtime/python37/bootstrap.py", line 133, in init_handler   func_handler = get_func_handler(file.rsplit(".", 1), func)   File "/var/runtime/python37/bootstrap.py", line 159, in get_func_handler   mod = imp.load_module(mname, *imp.find_module(mname))   File "/var/lang/python37/lib/python3.7/imp.py", line 234, in load_module   return load_source(name, filename, file)   File "/var/lang/python37/lib/python3.7/imp.py", line 171, in load_source   module = _load(spec)   File "<frozen importlib._bootstrap>", line 696, in _load   File "<frozen importlib._bootstrap>", line 677, in _load_unlocked   File "<frozen importlib._bootstrap_external>", line 728, in exec_module   File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed   File "/var/user/index.py", line 3, in <module>   import requests, time, random ModuleNotFoundError: No module named 'requests'", "statusCode": 443}

qianshang666 发表于 2022-1-30 00:42

这不是很明显吗,没有requests包

yulinsoft 发表于 2022-1-30 07:49

水墨青云 发表于 2022-1-30 08:11

Python3.7不带依赖,需要自己打包依赖。
Python3.6带requests模块

三滑稽甲苯 发表于 2022-1-30 08:24

装个requests
cd src
pip3 install requests -t .

Mcreeper 发表于 2022-2-2 11:29

水墨青云 发表于 2022-1-30 08:11
Python3.7不带依赖,需要自己打包依赖。
Python3.6带requests模块

多谢,换了3.6就可以了
页: [1]
查看完整版本: 腾讯云函数报错