1

我正在尝试在没有互联网连接的armv7l 设备上为 python 3.9.8 设置 numpy 模块。

我尝试了很多版本,但我不断收到此错误:

Python 3.9.8 (main, Jan 13 2022, 11:11:29) 
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/numpy/core/__init__.py", line 23, in <module>
    from . import multiarray
  File "/usr/lib/python3.9/site-packages/numpy/core/multiarray.py", line 10, in <module>
    from . import overrides
  File "/usr/lib/python3.9/site-packages/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 "<stdin>", line 1, in <module>
  File "/usr/lib/python3.9/site-packages/numpy/__init__.py", line 144, in <module>
    from . import core
  File "/usr/lib/python3.9/site-packages/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 "/usr/bin/python3"
  * The NumPy version is: "1.22.1"

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'

我使用命令 pip3 install 'numpy_file'.whl

我从https://www.piwheels.org/project/numpy/下载了用于 armv7l 架构的轮文件

我已经尝试过从 numpy-1.19 到 numpy-1.22 的版本。这是 numpy/core 目录的内容:

root@triton1:~# ls /usr/lib/python3.9/site-packages/numpy/core/
__init__.py
__init__.pyi
__pycache__
_add_newdocs.py
_add_newdocs_scalars.py
_asarray.py
_asarray.pyi
_dtype.py
_dtype_ctypes.py
_exceptions.py
_internal.py
_internal.pyi
_machar.py
_methods.py
_multiarray_tests.cpython-39-arm-linux-gnueabihf.so
_multiarray_umath.cpython-39-arm-linux-gnueabihf.so
_operand_flag_tests.cpython-39-arm-linux-gnueabihf.so
_rational_tests.cpython-39-arm-linux-gnueabihf.so
_simd.cpython-39-arm-linux-gnueabihf.so
_string_helpers.py
_struct_ufunc_tests.cpython-39-arm-linux-gnueabihf.so
_type_aliases.py
_type_aliases.pyi
_ufunc_config.py
_ufunc_config.pyi
_umath_tests.cpython-39-arm-linux-gnueabihf.so
arrayprint.py
arrayprint.pyi
cversions.py
defchararray.py
defchararray.pyi
einsumfunc.py
einsumfunc.pyi
fromnumeric.py
fromnumeric.pyi
function_base.py
function_base.pyi
generate_numpy_api.py
getlimits.py
getlimits.pyi
include
lib
memmap.py
memmap.pyi
multiarray.py
multiarray.pyi
numeric.py
numeric.pyi
numerictypes.py
numerictypes.pyi
overrides.py
records.py
records.pyi
setup.py
setup_common.py
shape_base.py
shape_base.pyi
tests
umath.py
umath_tests.py

我还尝试了更改该文件名称并删除此部分的方法:“cpython-39-arm-linux-gnueabihf”或仅此“arm-linux-gnueabihf”,但它不起作用。

我被卡住了,所以请,如果您有任何想法,请告诉我。谢谢!

4

0 回答 0