简体   繁体   English

无法安装 numpy。 没有名为“numpy.core._multiarray_umath”的模块

[英]Unable to Install numpy. No module named 'numpy.core._multiarray_umath'

This is the complete error message I received:这是我收到的完整错误消息:

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.10 from "D:\hugging-face\nlp\Scripts\python.exe"
  * The NumPy version is: "1.21.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'

I checked my Python version by typing python -v it the output was 3.10.5 is that alright?我通过输入python -v它的 output 是 3.10.5 可以吗?

I tried checking the NumPy version by typing:我尝试通过键入以下内容检查 NumPy 版本:

import numpy
numpy.version

However, it gave me the same error about numpy.core.multiarray_umatch`.但是,它给了我关于 numpy.core.multiarray_umatch` 的相同错误。 So, I tried to install numpy by running the following command:因此,我尝试通过运行以下命令来安装 numpy:

pip install numpy

It gave me the following error:它给了我以下错误:

ImportError: cannot import name 'Mapping' from 'collections' (D:\python\lib\collections\__init__.py)

I would also like to add that there are two directories inside lib with names numpy and numpy-1.21.5.dist-info .我还想补充一点, lib中有两个目录,名称numpynumpy-1.21.5.dist-info So, I guess the library is already installed but I can;t use it for some reason.所以,我猜这个库已经安装了,但由于某种原因我不能使用它。

The contents of my pyvenv.cgf file are:我的pyvenv.cgf文件的内容是:

home = D:\python
include-system-site-packages = false
version = 3.7.4

What should I do?我应该怎么办?

This may work, just give it a try这可能有效,请尝试一下

as you are using python 3.10 you need to install numpy version greater than 1.21.5当您使用 python 3.10 时,您需要安装大于 1.21.5 的 numpy 版本

create new environment创造新环境

cd <path where you need your virtualenv>
python -m venv .venv

as you are using windows activate using virtual env .venv\Scripts\activate assuming your are already in the virtualenv folder当您使用 windows 激活时,使用 virtual env .venv\Scripts\activate假设您已经在 virtualenv 文件夹中

then try pip install numpy>=1.23然后尝试pip install numpy>=1.23

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 ModuleNotFoundError:matplotlib 导入时没有名为“numpy.core._multiarray_umath”的模块 - ModuleNotFoundError: No module named 'numpy.core._multiarray_umath' on matplotlib import kivy 中没有名为“numpy.core._multiarray_umath”的模块 - No module named 'numpy.core._multiarray_umath' in kivy TensorFlow - ModuleNotFoundError:没有名为“numpy.core._multiarray_umath”的模块 - TensorFlow - ModuleNotFoundError: No module named 'numpy.core._multiarray_umath' ModuleNotFoundError:没有名为“numpy.core._multiarray_umath”的模块(安装 TensorFlow 时) - ModuleNotFoundError: No module named 'numpy.core._multiarray_umath' (While installing TensorFlow) 发生异常:ImportError &quot;No module named &#39;numpy.core._multiarray_umath&#39;&quot; - Exception has occurred: ImportError "No module named 'numpy.core._multiarray_umath'" Windows VS 代码找不到 numpy 模块,即使它已安装(ModuleNotFoundError: No module named 'numpy.core._multiarray_umath') - Windows VS Code can't find numpy Module even though it is installed (ModuleNotFoundError: No module named 'numpy.core._multiarray_umath') pd.read_hdf抛出“无法将此数组的WRITABLE标志设置为True”和“没有名为“ numpy.core._multiarray_umath”的模块” - pd.read_hdf throws 'cannot set WRITABLE flag to True of this array' and 'No module named 'numpy.core._multiarray_umath' 当我安装 tensorflow 时,我收到以下错误 ImportError: cannot import name '_set_madvise_hugepage' from 'numpy.core._multiarray_umath' - when I installed tensorflow I get the following error ImportError: cannot import name '_set_madvise_hugepage' from 'numpy.core._multiarray_umath' 什么是 numpy.core._multiarray_umath.implement_array_function 以及为什么要花费大量时间? - what is numpy.core._multiarray_umath.implement_array_function and why it costs lots of time? `内置方法 numpy.core._multiarray_umath.implement_array_function` 是性能瓶颈吗? - Is `built-in method numpy.core._multiarray_umath.implement_array_function` a performance bottleneck?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM