首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
社区首页 >问答首页 >请问云函数把akshare库上传,为什么总遇到Numpy的C扩展模块未正确编译或环境路径冲突?

请问云函数把akshare库上传,为什么总遇到Numpy的C扩展模块未正确编译或环境路径冲突?

提问于 2025-02-27 15:52:05
回答 0关注 0查看 18

我的目的是将依赖库和脚本打包成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中重新安装了依赖并调整了打包方式,但问题依然存在。我需要仔细分析可能的原因,并提供解决方案。

回答

和开发者交流更多问题细节吧,去 写回答
相关文章

相似问题

相关问答用户
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档