Python 安装Jupyter笔记本电脑后,NumPy和TensorFlow无法工作

Python 安装Jupyter笔记本电脑后,NumPy和TensorFlow无法工作,python,anaconda,jupyter-notebook,importerror,Python,Anaconda,Jupyter Notebook,Importerror,今天我用Jupyter笔记本做了一些研究,发现我无法导入Tensorflow或Keras。这很奇怪,因为直到昨天它还运转良好。无论如何,我在网上查了一下,有人建议我使用conda install Jupyter notebook再次安装Jupyter。我就是这么做的,现在我甚至不能导入Tensorflow或NumPy。更不用说每当我试图打开Jupyter时,它也不起作用。我看到命令提示符短暂闪烁,然后什么也没发生 当我尝试导入其中一个时,会出现以下错误: --------------------

今天我用Jupyter笔记本做了一些研究,发现我无法导入Tensorflow或Keras。这很奇怪,因为直到昨天它还运转良好。无论如何,我在网上查了一下,有人建议我使用
conda install Jupyter notebook
再次安装Jupyter。我就是这么做的,现在我甚至不能导入Tensorflow或NumPy。更不用说每当我试图打开Jupyter时,它也不起作用。我看到命令提示符短暂闪烁,然后什么也没发生

当我尝试导入其中一个时,会出现以下错误:

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
~\Anaconda3\lib\site-packages\numpy\core\__init__.py in <module>
     39 try:
---> 40     from . import multiarray
     41 except ImportError as exc:

~\Anaconda3\lib\site-packages\numpy\core\multiarray.py in <module>
     11
---> 12 from . import overrides
     13 from . import _multiarray_umath

~\Anaconda3\lib\site-packages\numpy\core\overrides.py in <module>
      5
----> 6 from numpy.core._multiarray_umath import (
      7     add_docstring, implement_array_function, _get_implementing_args)

ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'

During handling of the above exception, another exception occurred:

ImportError                               Traceback (most recent call last)
<ipython-input-1-0aa0b027fcb6> in <module>
----> 1 import numpy as np

~\Anaconda3\lib\site-packages\numpy\__init__.py in <module>
    140     from . import _distributor_init
    141
--> 142     from . import core
    143     from .core import *
    144     from . import compat

~\Anaconda3\lib\site-packages\numpy\core\__init__.py in <module>
     69 Original error was: %s
     70 """ % (sys.executable, exc)
---> 71     raise ImportError(msg)
     72 finally:
     73     for envkey in env_added:

ImportError:

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the multiarray numpy extension module failed.  Most
likely you are trying to import a failed build of numpy.
Here is how to proceed:
- If you're working with a numpy git repository, try `git clean -xdf`
  (removes all files not under version control) and rebuild numpy.
- If you are simply trying to use the numpy version that you have installed:
  your installation is broken - please reinstall numpy.
- If you have already reinstalled and that did not fix the problem, then:
  1. Check that you are using the Python you expect (you're using 
C:\Users\seant\Anaconda3\python.exe),
     and that you have no directories in your PATH or PYTHONPATH that can
     interfere with the Python and numpy versions you're trying to use.
  2. If (1) looks fine, you can open a new issue at
     https://github.com/numpy/numpy/issues.  Please include details on:
     - how you installed Python
     - how you installed numpy
     - your operating system
     - whether or not you have multiple versions of Python installed
     - if you built from source, your compiler versions and ideally a build log

     Note: this error has many possible causes, so please don't comment on
     an existing issue about this - open a new one instead.

Original error was: No module named 'numpy.core._multiarray_umath'
---------------------------------------------------------------------------
ModuleNotFoundError回溯(上次最近调用)
~\Anaconda3\lib\site packages\numpy\core\\uuuuu init\uuuuuuuuu.py in
39尝试:
--->40美元。导入多数组
41除执行委员会外:
中的~\Anaconda3\lib\site packages\numpy\core\multiarray.py
11
--->12从。导入覆盖
13来自。导入_多数组_umath
中的~\Anaconda3\lib\site packages\numpy\core\overrides.py
5.
---->6来自numpy.core.\u多阵列\u umath导入(
7添加\u docstring、实现\u数组\u函数、\u获取\u实现\u参数)
ModuleNotFoundError:没有名为'numpy.core.\u multiarray\u umath'的模块
在处理上述异常期间,发生了另一个异常:
ImportError回溯(最近一次呼叫最后一次)
在里面
---->1作为np导入numpy
~\Anaconda3\lib\site packages\numpy\\uuuuuu init\uuuuuuuuuuuu.py in
140美元。导入\u分发服务器\u初始化
141
-->142来自。导入核心
143.核心进口*
144来自。进口同胞
~\Anaconda3\lib\site packages\numpy\core\\uuuuu init\uuuuuuuuu.py in
69原始错误为:%s
70”“”%(sys.exc可执行文件)
--->71提高安全性(味精)
72最后:
73对于环境中的环境密钥,添加了:
进口恐怖主义:
重要提示:请阅读本文,了解如何解决此问题的建议!
导入多数组numpy扩展模块失败。大多数
您可能正在尝试导入失败的numpy版本。
以下是如何继续:
-如果您正在使用numpy git存储库,请尝试使用`git clean-xdf`
(删除所有不受版本控制的文件)并重新生成numpy。
-如果您只是尝试使用已安装的numpy版本:
您的安装已中断-请重新安装numpy。
-如果您已经重新安装,但没有解决问题,则:
1.检查您是否正在使用预期的Python(您正在使用
C:\Users\seant\Anaconda3\python.exe),
在你的路径或PYTHONPATH中没有可以
干扰您尝试使用的Python和numpy版本。
2.如果(1)看起来不错,您可以在
https://github.com/numpy/numpy/issues.  请详细说明:
-您是如何安装Python的
-你是如何安装numpy的
-您的操作系统
-是否安装了多个版本的Python
-如果您是从源代码构建的,那么您的编译器版本和理想情况下的构建日志
注意:这个错误有很多可能的原因,所以请不要评论
关于此的现有问题-打开一个新的。
最初的错误是:没有名为“numpy.core.\u multiarray\u umath”的模块

我尝试重新安装NumPy,但没有解决问题。我通过安装Anaconda安装了Python和NumPy,我的操作系统是Windows 10。我的path变量看起来也很正常,直到现在一切都正常。有人知道我如何解决此问题吗?

转到您的终端,找到您所在的环境你已经安装了Numpy和其他模块。如果你使用VirtualNVRapper,你可以运行:
lsvirtualenv
将显示您拥有的虚拟环境列表

然后键入
workon
virtualenv1(替换为显示的虚拟环境的名称)并检查已安装的模块,例如,在选择虚拟环境后,您可以键入
python
进入shell。然后你可以执行
import numpy
等操作,检查你正在寻找的模块是否存在于该虚拟环境中。当你找到它们时,你可以退出shell,执行
pip install jupyter
操作,在虚拟环境上安装jupyter笔记本电脑和你需要的模块。避免遇到su解决未来的问题您应该确保在您的机器中维护虚拟环境,并按照virtual env使用您感兴趣的模块。VirtualEnvRapper是一个很好的工具,它可以抽象出使用虚拟环境时发现的大多数常见缺陷。有关管理和创建虚拟环境的详细信息。

在我的我刚刚花了大约一个小时卸载了所有与Python相关的东西(Python、Anaconda等),然后又从头开始安装了所有东西。这有点痛苦,但我不知道如果不深入研究这个问题,还能做什么