Single logo
  • Courses
  • Blog
  • About
Join on SkoolJoin on Skool

In this topic

Python
  • Python for AI: The Five Tools You Actually Need
  • Thinking Like a Python Architect in an AI-First World
  • Your First Python Program: print, Comments, sep and end
  • Set Up PyCharm for Python: Install, First Project and First Run
  • Run a Python File and Read the Error: Tracebacks in Three Steps
  • Python Data Types, Variables and Strings: Indexing, Slicing and f-strings
  • Python Operators: Arithmetic, Comparison, Logical, Membership, Identity and Precedence
  • Python Conditionals and Loops: if/elif/else, for, while, break and continue
  • Looping Over Real Data in Python: Dicts, Lists of Dicts, enumerate and zip
  • Checking AI-Written Python Code: A Six-Step Habit That Finds Three Hidden Faults
  • Python Basics Practice: Report Card, Shopping Cart and Password Checker from a Prompt
  • Python Functions: Parameters, Return, Scope (LEGB), *args and **kwargs
  • Type Hints on Python Functions: Parameters, Returns, None and Collections
  • Python lambda, map, filter, Modules and Packages (with pip and venv)
  • Python Functions Practice: Bonus Calculator, Product Pipeline and a Math Package
  • Python Lists, Tuples, Sets and Dicts, Plus Type Hints on Variables
  • Python Comprehensions: List, Dict, Set and Generator Expressions, Read as Loops
  • Python Class Methods, Static Methods and Properties: What Each One Receives
  • Python Classes and Objects: __init__, self and PEP 8 Names
  • Python Inheritance and Polymorphism: super(), Overriding and Duck Typing
  • Python Multiple Inheritance, the MRO and Mixins
  • Python Encapsulation and Special Methods: Underscores, __str__, __add__ and __len__
  • Python Composition, Abstract Classes and Dataclasses
  • Python OOP Practice: Design a Bank, an Employee System and a Library
  • Set Up a Python AI Project with uv, VS Code and an API Key in .env
  • uv and pyproject.toml: Start, Add, Run and Rebuild a Python Project
  • Python try and except Basics: Catch an Error and Keep Going
  • Read and Write a File in Python: open, with, Modes and Encoding
  • Python Custom Exceptions and Advanced Error Handling: raise, raise from and the Call Stack
  • Python Logging and Debugging: Levels, Handlers, logger.exception and breakpoint()
  • Python File Modes, pathlib and Context Managers: x, r+, rb, Path and __enter__/__exit__
  • Python CSV, JSON and Large Files: csv, json, yield Pipelines, tomllib and pickle
  • Python Practice: Build a Log File Analyzer and a File Organizer
  • Python Project Structure for AI-Assisted Development: Packages, config.py and AGENTS.md
  • Regular Expressions in Python: search, findall, Groups and Greedy vs Lazy
  • Testing Python Code with pytest: assert, parametrize, fixtures and pytest.raises
  • Async Python: async def, await, asyncio.gather and the Blocking Trap
  • Django, FastAPI or Flask? The Same Blog Feature in Three Shapes, and How to Choose
  • One Blog, Three Frameworks: Routing, Models, Templates and Layout in Django, FastAPI and Flask
  • Getting Started with Flask: Routes, Jinja2 Templates and WSGI in One Small App
  • Your First Flask App with uv: From an Empty Folder to a Page in Debug Mode
  • Flask Routes, Templates and url_for: Converters, Forms, Redirects and the Signed Session
  • Flask-SQLAlchemy Models and Flask-Migrate: From a Python Class to a Real Table
  • Building a Blog with an AI Coding Agent: Plan Mode, a Master Prompt and the First Review
  • Handing a Figma Design to an AI Agent: Compare the Files, Then Review the Change
  • Inside a Flask Blog: The App Factory, Blueprints, the Instance Folder and CORS Done Right
  • How a Request and a Login Flow Through a Flask Blog: Flask-Login, CSRF and the Signed Session
  • Testing a Flask Blog with pytest: A Test App from the Factory, Fixtures and the Test Client
  1. Blog
  2. /
  3. Python
  4. /
  5. Basics

Set Up PyCharm for Python: Install, First Project and First Run

Install PyCharm, create a Pure Python project, and understand the two words that confuse beginners: the interpreter (the cook) and .venv (the project's own shelf). Then run a file and read the exit code.

Chaand Sheikh

·27 November 2026·Updated 28 November 2026Basics

What you will learn

  • Download and install PyCharm with the useful installer options
  • Create a Pure Python project with its own .venv
  • Explain what the Python interpreter and .venv are
  • Run a file and read the Run window, including the exit code

Before you start

  • A Windows, Mac or Linux computer
  • Your First Python Program

You can write Python in any plain text editor. But then you still need something to run it, and something to help you find mistakes. An IDE (integrated development environment) puts all of that in one window, so you write, run and fix code in the same place.

The IDE we'll use is PyCharm, made for Python by JetBrains. The practice exercises in this course also come as PyCharm quizzes and code you can experiment with, so you learn an idea and practise it in the same window.

Download and install PyCharm

Open your browser, go to jetbrains.com/pycharm and click Download. On the download page, check your system is picked (Windows, Mac or Linux), then click the Download button. Newer versions may look a little different; the steps stay the same.

One product, core features free

PyCharm used to come in a free edition and a paid one. Now it's one product, so there's one thing to download. When you install it, a Pro trial starts and runs for 30 days. When that month ends, the Pro extras switch off, but the core features stay free and you can keep using them. You don't need to pay anything to get started.

The installer options

On Windows, open the file you downloaded and keep clicking Next until you reach a page of options. They're all worth ticking:

  • Create a desktop shortcut, so you can open PyCharm quickly.
  • Update the PATH, so you can start PyCharm from a terminal.
  • The right-click option, so you can open any folder as a project.
  • The .py association, so Python files open in PyCharm.

Click Install and give it a couple of minutes. On a Mac it's simpler: drag PyCharm into your Applications folder.

Start a new project

Open PyCharm. The first time it takes a moment, and your project list is empty, so click New Project. On the left is a list of project types. Pick Pure Python, the simplest one. Give it a name; mine is S01L03_Setup, but any name works.

Right under the name, PyCharm asks about an interpreter and a .venv. These two words stop a lot of beginners, so clear them up before you click anything.

What the Python interpreter is

Think about a recipe. It's only words on paper and can't cook anything by itself. To get a meal you need a cook who reads it from top to bottom and does each step.

Your .py file is the recipe; it's only text. The Python interpreter is the cook: a program that reads your file from top to bottom and carries it out. So when people say "install Python", they mean put the interpreter on your machine. Without it, PyCharm can't run your code.

A project's own .venv

A project may also need extras called libraries, the way a cook needs special ingredients. If all your projects share one shelf, a change made for one project can break another.

So each project gets its own shelf. That's .venv: a folder inside the project with a Python setup just for that project. Add a library there and it lands on this project's shelf; your other projects don't change. The name is short for virtual environment, and PyCharm makes it for you. If you want the full story, read Python virtual environments with venv.

main.py is the recipe, the interpreter inside the project's .venv is the cook, and the Run window shows the result main.py the recipe (text) .venv interpreter the cook this project's libraries Run window Hi, PyCharm Each project gets its own .venv, so one project's libraries never break another.
The file is the recipe, the interpreter is the cook, and .venv is the project's own shelf.

Finish the new project

Back to the form. Keep the option that makes a .venv for this project. For the Python version, pick the newest Python 3 it offers. PyCharm may find a Python already on your machine; if not, it offers to download one, so there's nothing else to install.

Leave the welcome script option ticked, because that gives you a small file to run, and click Create. PyCharm gets Python, builds .venv and creates your file. How long that takes depends on your internet speed.

The parts of the window

  • The Project tree on the left shows your files, including the .venv folder and main.py.
  • The editor in the middle is where you write code. Your welcome script may have extra comments; mine is one line.
  • The Run button, the green triangle, sits at the top right.
  • The Run window along the bottom is where output appears.
  • The bottom corner shows which interpreter the project uses. If it ever says no interpreter, click there to pick one.

Run your file

print("Hi, PyCharm")
Hi, PyCharm

Click Run. PyCharm hands main.py to the interpreter in .venv, the interpreter reads the line and carries it out, and the text comes out in the Run window.

Read the Run window

The Run window tells you three things, in order:

  1. The command: Python running main.py. On your machine it's longer, with the full path to the interpreter in .venv and then your file.
  2. Your output: Hi, PyCharm.
  3. A last line saying the process finished with exit code 0.

Exit code 0 means the program finished without a problem. Any other number means it stopped on one. Each time you run something, look at that last line.

Change it and run it again

Now make it yours. The line stays the same; only the words inside the quotes change. Here it is in a second file, new_message.py:

print("My first run, my own message")
My first run, my own message

You don't need to save, because PyCharm saves as you type. It's a new file, so right-click inside it and choose Run. Exit code 0 again. Change it, run it, read the output: you'll do this all through the course.

Common mistakes

  • No interpreter selected. The file won't run; pick one in the bottom corner.
  • Clicking the green Run button on a new file and running the old one. Right-click inside the new file and choose Run.
  • Ignoring the last line. Exit code 0 is fine; anything else means something stopped.

Quick recap

WordWhat it is
IDEone window to write, run and fix code
Interpreterthe program that reads your file and carries it out
.venvthe project's own Python setup and libraries
Run windowcommand, output, exit code
Exit code 0finished without a problem

Try it yourself

Change the message in main.py to your own words, run it again, and check that you get exit code 0. Then see what an error looks like in Run a Python file and read the error.

Tried the exercise? Share your answer or ask a question.

The StudyEasy AI Community is free to join, with the lesson files, notebooks and code.

Join free on Skool

Keep going in Python · 4 of 48

Previous
Your First Python Program: print, Comments, sep and end
Next post
Run a Python File and Read the Error: Tracebacks in Three Steps

Related course on Udemy

The Python Architect Masterclass: Full Stack to AI Engineer

Python, Django, FastAPI, React, Docker, AWS, LLMs, RAG, agents and MCP, from first steps to AI engineer.View on Udemy ↗: The Python Architect Masterclass: Full Stack to AI Engineer (paid course, opens in a new tab)

Related posts

Python for AI: The Five Tools You Actually Need

The small part of Python that carries most AI code: dicts and JSON, typed functions with a dataclass, comprehensions and f-strings, environment variables for keys, and try/except for replies that are not JSON. Three standard-library scripts on four support tickets.

Thinking Like a Python Architect in an AI-First World

Coding is laying bricks; architecting is deciding how the pieces fit. A two-line average function shows why someone still has to understand the code an AI tool writes.

Your First Python Program: print, Comments, sep and end

Five tiny files: print and quotes, top-to-bottom order, # comments, several values with sep and end, and the SyntaxError one missing quote causes. Every output is from a real run.

Run a Python File and Read the Error: Tracebacks in Three Steps

Run a file two ways, then break it on purpose. A NameError, an IndentationError, a TypeError and a three-frame traceback across two files, all read the same way: last line, line number, fix.

On this page

  • Download and install PyCharm
  • One product, core features free
  • The installer options
  • Start a new project
  • What the Python interpreter is
  • A project's own .venv
  • Finish the new project
  • The parts of the window
  • Run your file
  • Read the Run window
  • Change it and run it again
  • Common mistakes
  • Quick recap
  • Try it yourself
Community · Free to join
Single logo

StudyEasy AI Community

Hosted onSkool

Learn AI engineering, share what you build, and connect with other learners.

  • Free resources: lesson files, notebooks and code

  • Ask questions and join engineering discussions

  • Meet real people learning and building with AI

Join free on Skool

Related course on Udemy

The Python Architect Masterclass: Full Stack to AI Engineer

Python, Django, FastAPI, React, Docker, AWS, LLMs, RAG, agents and MCP, from first steps to AI engineer.View on Udemy ↗: The Python Architect Masterclass: Full Stack to AI Engineer (paid course, opens in a new tab)

Single logo

Empowering Education, One Course at a Time

About
About usContact us
Legal
Terms of UsePrivacy Policy

© 2026 StudyEasy Organization. All rights reserved.