Scientific mode tutorial
In this tutorial, you operate in Scientific Mode and use Matplotlib and NumPy packages to run and debug a Python code with data visualization.
Before you start, ensure the following is installed:
Creating a Scientific project
Create a PyCharm project with the scientific settings predefined
Open the New Project wizard ( File | New | Project ).
Choose Scientific project type.
In the project settings dialog window, specify a project name, ensure the Conda is selected as the new environment, and alter the default data folder (if needed), then click Create .
Open the main.py file and add the following code sample:
Process warnings shown for the numpy and matplotlib imports and enable the packages in the project.
Running
Run your scientific project Shift+F10 . The code is executed and shows two graphs in the SciView. Clicking the preview thumbnail displays the respective graph:

You can modify the project code to plot only one graph at a time. In the scientific mode, you can execute fragments of your code by creating code cells.
To execute code cells:
Modify the main.py file by adding the "#%%" lines.
In the gutter, click the icon Ctrl+Enter on line with the scatter plot cell mark. Only the scatter graph will be built.
Now click the icon or press Ctrl+Enter on the line with the y versus x plot cell mark. The corresponding graph should appear.
Debugging
Let’s put a breakpoint at the line:
This line appears twice in our example code, and so there will be two breakpoints.
Right-click the editor background and from the context menu choose Debug ‘main’ .
You see the Debug tool window and the grey characters in the editor. This is the result of the inline debugging, which is enabled.
The line with the first breakpoint is blue highlighted. It means that the debugger has stopped at the line with the breakpoint, but has not yet executed it. If we execute this line (for example, by clicking the button on the stepping toolbar of the Debug tool window), we’ll see the graph:

Next, look at the Variables tab of the Debug tool window. If you click the View as Array link nearby the area array, the Data tab in the SciView window opens:

When you process excessive amount of data, you might experience degradation of debugging performance if the debugger loads variable’s values synchronously or asynchronously . It is recommended to switch to the On demand mode by selecting the corresponding loading policy. See Managing Variables Loading Policy for more information.
Mind the only row of figures in the Data tab in the SciView — it’s explained by the fact that the area array is one-dimensional.
Running in console
Right-click the editor background and choose the Run File in Console command:

This command corresponds to running a run/debug configuration for the main.py file with the Run with Python console checkbox selected:

When this command is run, the >>> prompt appears after the output in the Run tool window, and you can execute your own commands.
Summary
So, what has been done with the help of PyCharm?
The file main.py was created and opened for editing.
The source code has been entered (note the powerful PyCharm’s code completion!)
Can't install matplotlib to pycharm
I have recently started to learn python programming using Python Crash Course. I am stuck as I can’t get matplotlib to work in pycharm.
I have pip installed. I have installed matplotlib using pip via command prompt.
Now, when I open pycharm and go file->settings->project interpreter->download packages and find and press install for matplotlib, I get an error: Command «python setup.py egg_info» failed with error code 1 in C:\Users\Tony\AppData\Local\Temp\pip-install-f2h0rvbb\matplotlib\ . When installing on pycharm it says its using cached file from website I didn’t download my matplotlib from.
I have tried «pip install matplotlib» from pycharm terminal and get the same error.
I have tried typing «pip install matplotlib» from cmd and it does so and says its already satisfied.
Any help or guidance would be appreciated, thanks.
3 Answers 3
Managed to get it to work by typing into pycharm terminal:
pip install updates
Then I went to file->settings->project interpreter-> then found pip via search and updated it again to be more sure. Once pip version on left hand side of column in file->settings->project interpreter showed the version to be the newest 20.0.2 which was == to the right hand side(latest version) column it was 100% updated. This can be done also by pressing the upgrade button just above the ‘show early releases’ button which looks like an eye just to the right of the right hand side column when you have already clicked on the package.
To finish I went file->settings->project interpreter-> found matplotlib and installed package successfully.
Русские Блоги
Как установить Matplotlib в Python и использовать в PyCharm или IDLE
Вы также можете попробовать установить PyCharm на шаге 5, может быть быстрее.
1. Сочетание клавиш WIN + R, введите CMD, чтобы открыть командную окно DOS.
2. Хотя у меня есть PIP во время загрузки Python, я обновить PIP, введите обновленную команду PIP:

3. Использование PIP для загрузки Matplotlib:
Если вы используете команду непосредственно:pip install matplotlibТрудно добиться успеха.
Укажите внутреннее зеркальное отображение при установке модуля:
Например, я установил Matplotlib следующим образом:
4. Введите список PIP, чтобы увидеть, какие пакеты вы установили
В это время простоя должен быть в состоянии использовать его непосредственно. Вы можете проверить это с помощью метода конечных испытаний.
5. PPLOTLIB в PyCharm:
Открыть PyCharm, выберите Файл-Настройки (File — Set), а затем нажмите на Porject (как показано ниже)

Если у вас есть пакет, который вы установите под пакет, вы можете использовать его. Но если нет, то вы можете скачать его здесь:
6. Скачать Matplotlib прямо в PyCharm:
Нажмите на маленькую сторону с правой стороны верхней части. + После:

Настройте путь загрузки:
Я попробовал оригинальный путь загрузки и Alibaba Cloud путь загрузки ошибка, и нет никаких проблем с Douban.

После настройки пути, выберите Нажмите для загрузки, вы можете. (Сконфигурированной, в основном не проблема)
7. Тест: Использование PyCharm или Идель запустить Netizen код:
В результате ОК следующим образом: