[英]I have installed numpy, yet it somehow does not get imported in my jupyter notebook
I have installed numpy using pip install numpy In the current directory.我已经安装了 numpy 使用 pip install numpy 在当前目录中。 But when I try to import it in my jupyter notebook, it gives an error.但是当我尝试在我的 jupyter notebook 中导入它时,它给出了一个错误。 ModuleNotFoundError Traceback (most recent call last) ~\AppData\Local\Temp/ipykernel_17100/2172125874.py in ----> 1 import numpy ModuleNotFoundError Traceback (最近一次调用最后) ~\AppData\Local\Temp/ipykernel_17100/2172125874.py in ----> 1 import numpy
ModuleNotFoundError: No module named 'numpy' ModuleNotFoundError:没有名为“numpy”的模块
Please help me resolve this problem.请帮我解决这个问题。 I have tried uninstalling numpy and re-installing, yet it does not work at all.我已经尝试卸载 numpy 并重新安装,但它根本不起作用。 I am using a Windows 10 system.我正在使用 Windows 10 系统。
First, pip install numpy
will install NumPy package in python/site-package, not the current directory.首先, pip install numpy
将安装 NumPy ZEFE90A8E604A7C840E88D03AZ6F 的当前目录在python/site-package 中。 You can type pip show numpy
in the terminal to check its information(path, version...).您可以在终端中键入pip show numpy
以查看其信息(路径,版本...)。
Secondly, Maybe the interpreter you choose in Jupyter notebook is not the same as the one you installed numpy on.其次,可能你在 Jupyter notebook 中选择的解释器和你安装的 numpy 的解释器不一样。 You might need to check that.你可能需要检查一下。
To check Whether it has numpy.检查是否有 numpy。 You might use pip list
to check that, in case pip
corresponds to the interpreter you wanna check.您可以使用pip list
来检查,以防pip
对应于您要检查的解释器。
Hope this will help you.希望这会帮助你。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.