我的目的是将依赖库和脚本打包成zip上传云函数,全程都是在云IDE完成的,但日志为:
START RequestId: f214383b-49c4-4a3f-af18-7469ca365dab Init Report RequestId: f214383b-49c4-4a3f-af18-7469ca365dab Coldstart: 166ms (PullCode: 0ms InitRuntime: 3ms InitFunction: 163ms) Memory: 128MB MemUsage: 8.52MB ERROR RequestId: f214383b-49c4-4a3f-af18-7469ca365dab Result: {"errorCode": -1, "errorMessage": "Traceback (most recent call last): File "/var/user/numpy/core/__init__.py", line 23, in <module> from . import multiarray File "/var/user/numpy/core/multiarray.py", line 10, in <module> from . import overrides File "/var/user/numpy/core/overrides.py", line 6, in <module> from numpy.core._multiarray_umath import ( ModuleNotFoundError: No module named 'numpy.core._multiarray_umath' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/var/runtime/python39/bootstrap.py", line 133, in init_handler func_handler = get_func_handler(file.rsplit(".", 1)[0], func) File "/var/runtime/python39/bootstrap.py", line 159, in get_func_handler mod = imp.load_module(mname, *imp.find_module(mname)) File "/var/lang/python39/lib/python3.9/imp.py", line 234, in load_module return load_source(name, filename, file) File "/var/lang/python39/lib/python3.9/imp.py", line 171, in load_source module = _load(spec) File "<frozen importlib._bootstrap>", line 711, in _load File "<frozen importlib._bootstrap>", line 680, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 850, in exec_module File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed File "/var/user/index.py", line 8, in <module> import numpy as np File "/var/user/numpy/__init__.py", line 140, in <module> from . import core File "/var/user/numpy/core/__init__.py", line 49, in <module> raise ImportError(msg) ImportError: IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE! Importing the numpy C-extensions failed. This error can happen for many reasons, often due to issues with your setup or how NumPy was installed. We have compiled some common reasons and troubleshooting tips at: https://numpy.org/devdocs/user/troubleshooting-importerror.html Please note and check the following: * The Python version is: Python3.9 from "/var/lang/python39/bin/python3" * The NumPy version is: "1.23.5" and make sure that they are the versions you expect. Please carefully study the documentation linked above for further help. Original error was: No module named 'numpy.core._multiarray_umath' ", "statusCode": 443} END RequestId: f214383b-49c4-4a3f-af18-7469ca365dab Report RequestId: f214383b-49c4-4a3f-af18-7469ca365dab Duration: 0ms Memory: 128MB MemUsage: 8.52MB
这是ai的解读:用户又遇到了新的错误。这次是关于numpy的C扩展模块无法导入的问题。错误信息显示无法找到numpy.core._multiarray_umath模块,这可能是因为numpy的二进制文件没有正确安装或者与当前环境不兼容。用户之前按照我的建议在腾讯云IDE中重新安装了依赖并调整了打包方式,但问题依然存在。我需要仔细分析可能的原因,并提供解决方案。
相似问题