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

huus2vyu  于 2023-06-23  发布在  Python
关注(0)|答案(2)|浏览(154)

当我从我的3.9运行我的Python程序时。venv我得到了这个错误(什么是不清楚的我,是在错误中显示的python 3.6.网站包-但这个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
wbgh16ku

wbgh16ku1#

为我的环境找到了解决方案-

  • 卸载numpy

pip3 uninstall numpy
(had这样做3次,原因有3个不同的版本安装)

  • 卸载Pandas
  • 已安装的numpy
  • 已安装pandas
vktxenjb

vktxenjb2#

尝试将python39.lib放入vs2019->link->input

相关问题