Python 3.9。 - 原始错误是:没有名为 'numpy.core._multiarray_umath' 的模块

Python 3.9. - Original error was: No module named 'numpy.core._multiarray_umath'

当我运行宁我的 python-程序从我的 3.9。 venv 我得到了这个错误 (我不清楚的是,在错误中显示了 python 3.6.site 包 - 但是这个 venv kivypython3.9 在 3.9. 版本上...)

(kivypython39) rapid1898@rapid1898-B85-HD3:~/DEV/.venv/kivypython39/bin$ python3 -c "import numpy"
Traceback (most recent call last):
  File "/home/rapid1898/.local/lib/python3.6/site-packages/numpy/core/__init__.py", line 22, in <module>
    from . import multiarray
  File "/home/rapid1898/.local/lib/python3.6/site-packages/numpy/core/multiarray.py", line 12, in <module>
    from . import overrides
  File "/home/rapid1898/.local/lib/python3.6/site-packages/numpy/core/overrides.py", line 7, 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 "<string>", line 1, in <module>
  File "/home/rapid1898/.local/lib/python3.6/site-packages/numpy/__init__.py", line 140, in <module>
    from . import core
  File "/home/rapid1898/.local/lib/python3.6/site-packages/numpy/core/__init__.py", line 48, 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 "/home/rapid1898/DEV/.venv/kivypython39/bin/python3"
  * The NumPy version is: "1.19.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'

pip 列表显示(在其他模块旁边...)

(kivypython39) rapid1898@rapid1898-B85-HD3:~/DEV$ pip3 list
Package              Version
-------------------- ----------
numpy                1.19.5

当我 运行 我的程序在 3.6.环境一切正常

(kivyapp) rapid1898@rapid1898-B85-HD3:~/DEV$ python3 -c "import numpy"

在venv中安装了完全相同的版本:

(kivyapp) rapid1898@rapid1898-B85-HD3:~/DEV$ pip3 list
Package              Version
-------------------- ----------
numpy                1.19.5

找到适合我的环境的解决方案 -

  • 卸载了 numpy

    pip3 卸载 numpy

(必须这样做 3 次,因为那里安装了 3 个不同的版本)

  • 已卸载pandas
  • 已安装 numpy
  • 已安装pandas