ModuleNotFoundError: 找不到模块名为 ‘numpy’

huangapple go评论122阅读模式
英文:

ModuleNotFoundError: No module named 'numpy'

问题

我尝试在Python中导入NumPy来执行一些数组操作:

import numpy *

但是我收到了这个错误消息:

ModuleNotFoundError: 找不到模块'numpy'

我该怎么办?

英文:

I tried importing NumPy to carry out some array operations in Python:

import numpy *

But I got this error message:

> ModuleNotFoundError: No module named 'numpy'

What do I do?

答案1

得分: 5

如果您正在使用PyCharm,请打开PyCharm,然后转到菜单文件设置项目Python解释器点击'+' → 搜索并选择所需的包 → 安装包。

英文:

If you are using PyCharm, open PyCharm and go to menu File → Setting → Project → Python Interpreter → click on '+' → search and select the required package → install package.

答案2

得分: 3

使用以下命令:

pip3 install numpy

你将会得到以下响应。你会看到位置。

根据前面帖子中的说明,使用以下内容作为PATH。

已满足要求:numpy 在以下位置已安装:
c:\users\-用户名-\appdata\local\packages\pythonsoftwarefoundation.python.3.9_qbz5n2kfra8p0\localcache\local-packages\python39\site-packages (1.20.1)

NumPy 安装在这里,而不是在 "scripts" 文件夹中。

英文:

Use the following command

pip3 install numpy

You will get the following response. You see the location.

Use the following as PATH as per direction explained in the previous post.

Requirement already satisfied: numpy in c:\users\-user name-\appdata\local\packages\pythonsoftwarefoundation.python.3.9_qbz5n2kfra8p0\localcache\local-packages\python39\site-packages (1.20.1)

NumPy is installed here, not in "scripts".

答案3

得分: 1

NumPy似乎未安装在您的计算机上,但您可以使用以下命令安装它:

python -m pip install --user numpy

或者您可以在此处查看您的发行版的安装指南:
安装 SciPy

英文:

NumPy doesn't seem to be installed on your computer, but you can use this command to install it:

python -m pip install --user numpy

Or you can check the installation guide for your distribution here:
Install SciPy

答案4

得分: 0

您可以使用pip轻松安装NumPy:

pip install numpy
英文:

You can simply install NumPy with pip:

pip install numpy

答案5

得分: 0

Install NumPy with the pip install numpy command (ignore if already installed).

Import NumPy in either of the three ways:

  • import numpy
  • import numpy as np
  • from numpy import *
英文:

Install NumPy with the pip install numpy command (ignore if already installed).

Import NumPy in either of the three ways:

  • import numpy
  • import numpy as np
  • from numpy import *

huangapple
  • 本文由 发表于 2020年1月3日 16:08:12
  • 转载请务必保留本文链接:https://go.coder-hub.com/59575113.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定