简体   繁体   中英

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. Because of this, I need certain packages (ex. numpy) to do this and installed Anaconda.

When I tried to use the "import numpy" command in PyCharm, it did not work. I got ModuleNotFoundError: No module named '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.

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环境

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

You need to set your project interpreter to the python, that came with your anaconda installation.

Your installation path may differ from mine.

For a new project: 新项目设置

If you want to change the settings for an existing project: 现有项目的项目设置

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM