腾讯云函数报错
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} 这不是很明显吗,没有requests包 Python3.7不带依赖,需要自己打包依赖。Python3.6带requests模块 装个requests
cd src
pip3 install requests -t . 水墨青云 发表于 2022-1-30 08:11
Python3.7不带依赖,需要自己打包依赖。
Python3.6带requests模块
多谢,换了3.6就可以了
页:
[1]