[英]Getting numpy to import in Python (Pycharm), Anaconda installed
I am very new to python and I am trying to write a code to derive a first-order ODE. 我是python的新手,我正在尝试编写一个代码来派生出一阶ODE。 Because of this, I need certain packages (ex. numpy) to do this and installed Anaconda.
因此,我需要某些软件包(例如numpy)才能执行此操作并安装Anaconda。
When I tried to use the "import numpy" command in PyCharm, it did not work. 当我尝试在PyCharm中使用“import numpy”命令时,它不起作用。 I got ModuleNotFoundError: No module named 'numpy'.
我得到了ModuleNotFoundError:没有名为'numpy'的模块。
I am very new and need all the help I can get to get the programs linked. 我很新,需要我能得到的所有帮助才能将程序联系起来。
Thank you! 谢谢!
The best practice is to use a separate Conda environment for each of your projects, and then install what you need for your project in those. 最佳做法是为每个项目使用单独的Conda环境,然后在项目中安装项目所需的内容。
First, open Settings, and go to Project Settings | 首先,打开“设置”,然后转到“项目设置” Project Interpreter.
项目口译员。 Then use the gear icon on the top right, and choose to add a new local interpreter:
然后使用右上角的齿轮图标,并选择添加新的本地解释器:
Then, choose 'Conda Environment' on the left-hand side, and make sure to choose the Python version you want (if you're not sure, 3.6 is a good choice). 然后,选择左侧的“Conda Environment”,并确保选择所需的Python版本(如果您不确定,3.6是一个不错的选择)。
Finally, use the green '+' icon on the interpreter page to install a new package, just look for 'Numpy' and install it from the dialog there: 最后,使用解释器页面上的绿色“+”图标来安装新包,只需查找“Numpy”并从对话框中安装它:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.