英文:
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 *
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论