简体   繁体   English

ModuleNotFoundError:matplotlib 导入时没有名为“numpy.core._multiarray_umath”的模块

[英]ModuleNotFoundError: No module named 'numpy.core._multiarray_umath' on matplotlib import

I'm trying to run a simple testfile on a remote Server.我正在尝试在远程服务器上运行一个简单的测试文件。 But it throws a numpy error for matplotlib.pyplot.但它会为 matplotlib.pyplot 引发 numpy 错误。 Here is the code这是代码

import matplotlib.pyplot as plt
import numpy as np


# Fixing random state for reproducibility
np.random.seed(19680801)


x, y = np.random.randn(2, 100)
print('x')
print(x)
print('y')
print(y)
fig, [ax1, ax2] = plt.subplots(2, 1, sharex=True)
ax1.xcorr(x, y, usevlines=True, maxlags=50, normed=True, lw=2)
ax1.grid(True)

ax2.acorr(x, usevlines=True, normed=True, maxlags=50, lw=2)
ax2.grid(True)

plt.show()

Here is the error message.这是错误消息。

PyTorch/1.7-py36-cuda11/numpy/core/overrides.py", line 7, in from numpy.core._multiarray_umath import ( ModuleNotFoundError: No module named 'numpy.core._multiarray_umath' PyTorch/1.7-py36-cuda11/numpy/core/overrides.py”,第 7 行,从 numpy.core._multiarray_umath 导入(ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'

During handling of the above exception, another exception occurred:在处理上述异常的过程中,又出现了一个异常:

Traceback (most recent call last): File "graph_test.py", line 1, in import matplotlib.pyplot as plt Traceback(最近一次调用最后):文件“graph_test.py”,第 1 行,在 import matplotlib.pyplot as plt

/PyTorch/1.7-py36-cuda11/numpy/core/ init .py", line 48, in 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 /PyTorch/1.7-py36-cuda11/numpy/core/init .py",第 48 行,在引发 ImportError(msg) ImportError:重要:请阅读此内容以获取有关如何解决此问题的建议。导入 numpy C 扩展失败, 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.7 from "/projects/smiles/Model/venv/bin/python" Python 版本为:Python3.7 from "/projects/smiles/Model/venv/bin/python"
  • The NumPy version is: "1.19.4" NumPy 版本为:“1.19.4”

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'原始错误是:没有名为“numpy.core._multiarray_umath”的模块

Python Version: 3.7.5 Python 版本:3.7.5

Numpy Version: 1.19.4 Numpy 版本:1.19.4

Matplotlib version: 3.3.3 Matplotlib 版本:3.3.3

According to the site given by the library numpy:根据库 numpy 给出的站点:

to fix the error you need to check couple things that commonly gives this error:要修复错误,您需要检查通常会出现此错误的几件事:

1- Check if you are using the right version of python and the right version of numpy, check the documentation fo further information.(you might also have multiple versions of python that can affect the run of your libraries)+ try the newer version of numpy 1.19.5 1-检查您是否使用了正确版本的 python 和正确版本的 numpy,查看文档以获取更多信息。(您可能还有多个版本的 python 可能会影响您的库的运行) numpy 1.19.5

2- check if your python path is in the environment variables of your system. 2-检查您的 python 路径是否在系统的环境变量中。 you can check your path by running this command in your terminal:您可以通过在终端中运行以下命令来检查您的路径:

import os

print("PYTHONPATH:", os.environ.get('PYTHONPATH'))

print("PATH:", os.environ.get('PATH'))

3- try to uninstall and reinstall the numpy library(make sure to install the right version to satisfy what ever program you want to run) 3-尝试卸载并重新安装 numpy 库(确保安装正确的版本以满足您想要运行的任何程序)

4- if any of the above solutions didn't work, I highly recomend to install the anaconda installer here is a link to it: https://www.anaconda.com/products/individual 4-如果上述任何解决方案都不起作用,我强烈建议安装 anaconda 安装程序,这里有一个链接: https://www.Z7E3332C5FD0270D97C964E52BA184ADZZ

and that because anaconda most likely solve the problems of downloading libraries/ errors you get from those libraries.并且因为 anaconda 最有可能解决从这些库中下载库/错误的问题。

Hopefully those solutions helped you, and feel free to ask any question regarding it.希望这些解决方案对您有所帮助,并随时提出有关它的任何问题。

暂无
暂无

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

相关问题 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) kivy 中没有名为“numpy.core._multiarray_umath”的模块 - No module named 'numpy.core._multiarray_umath' in kivy 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') 无法安装 numpy。 没有名为“numpy.core._multiarray_umath”的模块 - Unable to Install numpy. No module named 'numpy.core._multiarray_umath' 发生异常:ImportError "No module named 'numpy.core._multiarray_umath'" - Exception has occurred: ImportError "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' 当使用matplotlib时,我得到`没有名为_multiarray_umath的模块 - I get `No module named _multiarray_umath` when using matplotlib 当我安装 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' 导入 matplotlib.backends.backend_tkagg - ModuleNotFoundError:没有名为“PIL”的模块 - import matplotlib.backends.backend_tkagg - ModuleNotFoundError: No module named 'PIL'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM