Create your first Python project in PyCharm
- 1
Open PyCharm and create a new project
Click New Project. Set the project location. Under "Python Interpreter", select "New environment using Virtualenv". Click Create.
- 2
Create a Python file
Right-click the project name → New → Python File. Name it
main.py. - 3
Write and run your first code
print("Hello, PyCharm!")# Press Shift+F10 to run, or right-click > Run 'main'Hello, PyCharm! - 4
Install a package
Open the terminal (Alt+F12) and run
pip install requests. Or: Settings → Python Interpreter → click + to browse and install packages.
5 shortcuts every beginner should learn
| Shortcut | What it does |
|---|---|
| Shift+F10 | Run current file |
| Alt+Enter | Fix error / import module |
| Ctrl+Space | Show code completion |
| Ctrl+/ | Comment or uncomment line |
| Shift+Shift | Search for anything |
Beginner questions
Do I need to install Python before installing PyCharm?
Yes. PyCharm is an IDE, not a Python runtime. Install Python from python.org first (check "Add Python to PATH" during install). Then install PyCharm and it will detect your Python installation automatically.
What is the difference between a script and a project in PyCharm?
A project is a folder containing your Python files, virtual environment and configuration. A script is a single .py file inside the project. PyCharm works best with projects because it tracks dependencies, settings and version control at the project level.