好友
阅读权限40
听众
最后登录1970-1-1
|
夕尘幽兰
发表于 2022-2-5 23:53
START RequestId: 7f946364-06ce-4065-92ce-66ab8a4a4114
Init Report RequestId: 7f946364-06ce-4065-92ce-66ab8a4a4114 Coldstart: 270ms (PullCode: 69ms InitRuntime: 4ms InitFunction: 197ms) Memory: 128MB MemUsage: 7.89MB
ERROR RequestId: 7f946364-06ce-4065-92ce-66ab8a4a4114 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)[0], 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 9, in <module> import requests ModuleNotFoundError: No module named 'requests'", "statusCode": 443}
END RequestId: 7f946364-06ce-4065-92ce-66ab8a4a4114
Report RequestId: 7f946364-06ce-4065-92ce-66ab8a4a4114 Duration: 0ms Memory: 128MB MemUsage: 7.89MB
START RequestId:7f946364-06ce-4065-92ce-66ab8a4a4114
ERROR RequestId:7f946364-06ce-4065-92ce-66ab8a4a4114 Result:{"errorCode":-1,"errorMessage":"Traceback (most recent call last):\n File \"/var/runtime/python37/bootstrap.py\", line 133, in init_handler\n func_handler = get_func_handler(file.rsplit(\".\", 1)[0], func)\n File \"/var/runtime/python37/bootstrap.py\", line 159, in get_func_handler\n mod = imp.load_module(mname, *imp.find_module(mname))\n File \"/var/lang/python37/lib/python3.7/imp.py\", line 234, in load_module\n return load_source(name, filename, file)\n File \"/var/lang/python37/lib/python3.7/imp.py\", line 171, in load_source\n module = _load(spec)\n File \"\u003cfrozen importlib._bootstrap\u003e\", line 696, in _load\n File \"\u003cfrozen importlib._bootstrap\u003e\", line 677, in _load_unlocked\n File \"\u003cfrozen importlib._bootstrap_external\u003e\", line 728, in exec_module\n File \"\u003cfrozen importlib._bootstrap\u003e\", line 219, in _call_with_frames_removed\n File \"/var/user/index.py\", line 9, in \u003cmodule\u003e\n import requests\nModuleNotFoundError: No module named 'requests'","statusCode":443}
END RequestId:7f946364-06ce-4065-92ce-66ab8a4a4114
Report RequestId:7f946364-06ce-4065-92ce-66ab8a4a4114 Duration:0ms Memory:128MB MemUsage:0.000000MB
所有的需要改自己KEY的地方,都改了,腾讯云函数报错如上,
Pycharm本地测试报错:
Traceback (most recent call last):
File "D:/pythonProject/Weather01.py", line 390, in <module>
main()
File "D:/pythonProject/Weather01.py", line 369, in main
desp = get_desp();
File "D:/pythonProject/Weather01.py", line 224, in get_desp
tiangou = get_tiangou();
File "D:/pythonProject/Weather01.py", line 197, in get_tiangou
tiangou = tiangou_json["newslist"][0]["content"]
KeyError: 'newslist'
进程已结束,退出代码1
@g1201314 |
|