PyCharm Tutorial: Getting Started with PyCharm

PyCharm, created by the Czech company JetBrains, is a popular Integrated Development Environment (IDE) used in programming, particularly for the Python programming language. It is written in Java and Python, and its initial release was in February of 2010. PyCharm works with Windows, macOS, and Linux versions.

Upon installing PyCharm in your computer, you may also wish to refer to our tutorial on python for beginners.

It provides a graphical debugger, an integrated unit tester, coding assistance, support for web development with Django, and integration with Anaconda’s data science platform.

This PyCharm installation tutorial will help you learn how to create new projects, add files to projects, customize the UI, run and debug Python code, and explore a lot of other features.

PCP in AI and Machine Learning

In Partnership with Purdue UniversityExplore Course
PCP in AI and Machine Learning

How to Install Numpy in PyCharm

You can download PyCharm from the JetBrains website.


Once you click on download, it will give you two options: Professional or Community. The professional edition of PyCharm requires a subscription, while the community edition is free.


For this PyCharm tutorial, we will use the community edition. This will start downloading the .exe file. After the download is complete, run the file to install PyCharm.



Click on Finish to complete the PyCharm Community edition setup. 

FREE Data Science With Python Course

Start Learning Data Science with Python for FREEStart Learning
FREE Data Science With Python Course


Now that the installation is complete, let us discuss the PyCharm UI in this PyCharm tutorial. In the PyCharm UI, your options include File, Edit, View, Navigate, Code, Tools, VCS, Window, and Help.


If you want to make changes to the environment and the interface, click on File and go to Settings.



Now, to write your Python script, go to File and select New Scratch File.


Python Training Course

Learn Data Operations in PythonExplore Course
Python Training Course

How to Create a Project in PyCharm?

Next in this PyCharm tutorial, let's create a new project by going to File and selecting New Project. Choose a name for the project and select create. You will see a pop-up asking how you want to open the project. I’ll choose This Window.


It will take a while to create a virtual environment. Once it’s ready, start by naming your project, and then, right-click it, go to New and select Python file. Name the Python file you have created. In our example, we’ve named it PyCharm.



At the bottom of the PyCharm window, you will find the Python Console, Terminal, and TODO options.

Let us continue this PyCharm tutorial performing some basic mathematical operations by importing the math module. It uses a full function (abs) to return the total value of a number.


You can see the Add Configuration option has changed to the name of the Python file. Next, click the green run button to execute your code. The Add Configuration will be reset every time you create a new project. There is a Run tab that comes up once your code executes successfully to display the output.

In the Python console, you can run one line of code, which will generate output beneath it.


PyCharm has a Refractor option, which allows you to rename a variable throughout the code. To do this, select the variable name, right-click and choose Refractor, and then click Rename.


How to Import NumPy in PyCharm?

In the next section of this PyCharm tutorial, we will cover how to import the NumPy module in PyCharm. However, if we use the following lines of code to import NumPy, it will throw an error.


To install NumPy on PyCharm, click on File and go to the Settings. Under Settings, choose your Python project and select Python Interpreter. Then, search for the NumPy package and click Install Package.



Free Course: Python for Beginners

Master the fundamentals of PythonEnroll Now
Free Course: Python for Beginners

Now, let's rerun the code, and you can see this time that it executed successfully.


You can close your project by going to the File menu and selecting the Close Project.

If you want to open any file in PyCharm, select Open from the File menu and browse to the correct one. It will ask, “How would you like to open the project?”.  Select the method that works for you. 

You can edit the configuration of a project by selecting the name of the file and clicking on Edit Configurations.


This allows you to edit the Environment variables, choose the type of Python interpreter you need, select the Working directory, and so on.


Free Course: Programming with Python

Learn the Basics of Programming with PythonEnroll Now
Free Course: Programming with Python

PyCharm offers multiple ways to run the code:

  1. Click on the Run tab on the menu bar.
  2. Select the green run button.
  3. Hit Shift+F10.
  4. Right-click and select Run.

You can select each line of code, and it will show a red-colored point, which refers to the breakpoint.


To debug a program, select the bug option present on the top right or click on Run from the menu bar and choose Debug. It will execute until the breakpoint, which can be continued until completion by pressing F8.


Below is a small script that can help you understand more about how PyCharm works. Once you run this program, it will prompt you for inputs in the console.

st = input(“Enter X and Y”)

X, Y=[int(x) for x in st.split(‘,’)]


If you try to give anything other than integer as inputs, it will throw an error.


FREE Data Science and AI Courses

Master basic & advanced skills, concepts and toolsStart Learning
FREE Data Science and AI Courses

Let’s create a list and see how it works:

st = input(“Enter X and Y”)

X, Y=[int(x) for x in st.split(‘,’)]

lst = [[0 for col in range(Y)] for row in range(X)]



It results in a nested list with four zeros in each list.

Let's look at another example to see how you can loop through a list:

st = input(“Enter X and Y”)

X, Y=[int(x) for x in st.split(‘,’)]

lst = [[0 for col in range(Y)] for row in range(X)]

for row in range(X):
      for col in range(Y):

      lst[row][col] = row*col

for row in range(X):

loop through

The following code will print the elements in a list horizontally:

st = input(“Enter X and Y”)

X, Y=[int(x) for x in st.split(‘,’)]

lst = [[0 for col in range(Y)] for row in range(X)]

for row in range(X):
    for col in range(Y):

        lst[row][col] = row*col

for row in range(X):
   for col in range(Y):


The code below allows users to print each row with one underneath the other.

st = input(“Enter X and Y”)

X, Y=[int(x) for x in st.split(‘,’)]

lst = [[0 for col in range(Y)] for row in range(X)]

for row in range(X):
    for col in range(Y):

        lst[row][col] = row*col

for row in range(X):


Python has wonderful data visualization libraries, such as Matplotlib, that help you build interactive graphs and charts. Go to Settings and in Python Interpreter, search for Matplotlib, and click on Install Package.

Here is a simple straight-line graph plotted using Matplotlib:

import matplotlib.pyplot as plt



In the last section of this PyCharm tutorial, we will learn how to import a .csv file onto PyCharm using Pandas.

Learn data operations in Python, strings, conditional statements, error handling, and the commonly used Python web framework Django with the Python Training course.

How to import a .csv file onto PyCharm using Pandas?

Pandas is a widely popular library used for data analysis and manipulation in Python. You need to import the pandas package to use it. To do so, go to File menu >> Settings >> Python Interpreter >> Search for pandas >> install package.

The program below will help you import a CSV file onto PyCharm and store it as a data frame using the pandas library.

import pandas as pd

path = “D:/cars.csv”

df = pd.read_csv(path)



If you want to see the first five records of the data frame, use the head() function.


With that we have come to the end of the Pycharm installation guide.


We hope this article helped you understand how to work with the Python language using the PyCharm IDE. You would've learned how to download and set up the PyCharm IDE, create a project and Python file, configure the settings, write simple code in Python, and run it in various ways. You got an idea of how to install packages, such as NumPy, Matplotlib, and pandas. Finally, you imported a .csv file onto PyCharm using pandas. That’s just some basics. If you want to learn more complex Python coding, enroll in our Python Training Course today! Hope you liked the article, in case of any doubts leave your questions below.

About the Author

Avijeet BiswalAvijeet Biswal

Avijeet is a Senior Research Analyst at Simplilearn. Passionate about Data Analytics, Machine Learning, and Deep Learning, Avijeet is also interested in politics, cricket, and football.

View More
  • Disclaimer
  • PMP, PMI, PMBOK, CAPM, PgMP, PfMP, ACP, PBA, RMP, SP, and OPM3 are registered marks of the Project Management Institute, Inc.
  • *According to Simplilearn survey conducted and subject to terms & conditions with Ernst & Young LLP (EY) as Process Advisors