PyCharm
From Install to Remote Dev
Master the world's most powerful Python IDE — from your first venv to running code on a remote server over SSH.
Visual Debugger
Set breakpoints, step through code line-by-line, inspect any variable — all without touching the terminal.
True Remote Development
Write code locally, run it on a remote server over SSH. Your files sync automatically. Feels like the server is your laptop.
Free for Students
JetBrains gives every student with a .edu email a free Professional license — worth $249/year. No credit card needed.
Install & Student License
- Community vs Professional
- Free Pro license with .edu email
- First-launch project setup
Interface Tour
- Project panel, editor, tool windows
- Status bar & Python interpreter indicator
- Search Everywhere & quick actions
Interpreters & venv
- System Python vs virtualenv vs conda
- Create & switch interpreters in PyCharm
- Install packages via GUI
Debugging
- Breakpoints, step over, step into
- Variables panel & watches
- Interactive debugger animation
Terminal
- Built-in terminal with venv auto-activation
- Multiple tabs & split terminals
- Python Console & Jupyter
Git in PyCharm
- Commit, push, pull from the IDE
- Visual diff & merge tool
- Branch management & log viewer
SSH & Remote Interpreter
- Add SSH credentials in PyCharm
- Configure a remote Python interpreter
- Run & debug code on a remote server
Deployment & File Mapping
- SFTP server configuration
- Local ↔ remote path mapping
- Auto-upload, sync, remote file browser
Shortcut Cheat Sheet
- Every essential shortcut by category
- Mac & Windows/Linux side-by-side
- Copy any shortcut with one click
Community vs Professional
| Feature | Community (Free) | Professional (Free with .edu) |
|---|---|---|
| Python editing & completion | ✅ | ✅ |
| Debugger | ✅ | ✅ |
| Git integration | ✅ | ✅ |
| SSH Remote Interpreter | 🚫 | ✅ |
| Deployment & file sync | 🚫 | ✅ |
| Jupyter Notebook support | 🚫 | ✅ |
| Database tools | 🚫 | ✅ |
| Django / Flask support | 🚫 | ✅ |
| Docker integration | 🚫 | ✅ |
.edu email address, you qualify for JetBrains' free educational license — this gives you PyCharm Professional plus every other JetBrains IDE.Step 1 — Get the Free Student License
Navigate to jetbrains.com/student and click "Apply now".
yourname@university.edu). JetBrains verifies it automatically — no documents needed.Click the confirmation link. JetBrains will create a JetBrains Account linked to your .edu address.
Choose the Professional edition. There is also a JetBrains Toolbox App (recommended) that manages all JetBrains IDEs and updates them automatically.
On first launch, choose "Log in to JetBrains Account" and enter the account you created with your .edu email. The license activates instantly.
First-Launch Setup
On the welcome screen, click "New Project". Choose a folder, select "Python" as project type, and pick "New environment using Virtualenv" — PyCharm will create a virtual environment automatically.
PyCharm will look for Python installations on your system. If you don't see Python 3.10+, install it from python.org first, then re-open PyCharm.
~/projects/my_project/.venvRight-click the project root in the Project panel → New → Python File. Name it main.py. Type print("Hello, PyCharm!") and press ⌃R (Mac) or Shift+F10 (Windows) to run it.
- Apply for JetBrains Student License with your .edu email
- Download and install PyCharm Professional
- Activate with your JetBrains Account
- Create a new project with a virtualenv and run
print("Hello")
The PyCharm Layout
1 def greet(name):
2 return f"Hello, {name}!"
3
4 ● result = greet("World")
5 print(result)
Key Areas
| Area | What it's for | How to open |
|---|---|---|
| Project Panel | File tree of your project | ⌘1 / Alt+1 |
| Editor | Where you write code — center stage | Click any file |
| Run Panel | Output from running your script | ⌘4 / Alt+4 |
| Debug Panel | Breakpoints, variables, call stack | ⌘5 / Alt+5 |
| Terminal | Shell inside the IDE | ⌥F12 / Alt+F12 |
| Python Console | Interactive REPL | Tools → Python Console |
| Git Panel | Commit, log, branches | ⌘9 / Alt+9 |
| Deployment | Remote server file sync | Tools → Deployment |
The Most Important Shortcuts
| Action | Mac | Windows/Linux |
|---|---|---|
| Search Everywhere | ⇧⇧ (double Shift) | Shift Shift |
| Run file | ⌃R | Shift+F10 |
| Debug file | ⌃D | Shift+F9 |
| Find & Replace | ⌘R | Ctrl+R |
| Go to definition | ⌘B or ⌘Click | Ctrl+B or Ctrl+Click |
| Reformat code | ⌘⌥L | Ctrl+Alt+L |
| Comment/uncomment | ⌘/ | Ctrl+/ |
| Settings | ⌘, | Ctrl+Alt+S |
- Open the Project panel (⌘1) and find your
main.py - Use double-Shift to search for "Python Console" and open it
- Run your script with ⌃R and see output in the Run panel
- Change the theme: Settings → Appearance → Theme
Types of Interpreters
Create a New Virtualenv
Mac: ⌘, → Project → Python Interpreter. Windows: Ctrl+Alt+S → Project → Python Interpreter.
Select Virtualenv Environment → New. PyCharm suggests a path like project-folder/.venv. Choose the base Python version (e.g., Python 3.11).
You'll see the interpreter change in the status bar (bottom right). Future package installs go into this venv only.
Switch Between Interpreters
Click the interpreter name in the bottom-right status bar — a popup lets you switch instantly between any interpreter configured for that project.
Install Packages via PyCharm
You see a list of installed packages. Click the + button.
PyCharm runs pip install numpy in your venv. You can see the output in the panel below.
requirements.txt automatically. If it sees missing packages, a yellow banner appears in the editor with a one-click "Install requirements" button.Conda Environments
# Create a conda environment with a specific Python version conda create -n ml-project python=3.11 numpy pandas scikit-learn conda activate ml-project # Then in PyCharm: Add Interpreter → Conda Environment → Existing # PyCharm finds conda automatically if it's in your PATH
- Open Settings → Python Interpreter and see the current venv
- Install the
requestspackage via the PyCharm GUI - Click the interpreter in the status bar and confirm it shows your venv
print() statements everywhere, you set a breakpoint — the program stops there and waits for your instructions.
Interactive Debugger — Step Through Code
Press Run Debug to start. Use the buttons to step through the code and watch the variables update in real time.
Debug Controls
| Control | Mac | Win/Linux | What it does |
|---|---|---|---|
| ▶ Resume / Run Debug | ⌃D | Shift+F9 | Start debug / run to next breakpoint |
| ⤵ Step Over | F8 | F8 | Execute current line, stay in this function |
| ⤴ Step Into | F7 | F7 | Step into the function call on current line |
| ⤶ Step Out | ⇧F8 | Shift+F8 | Finish current function, return to caller |
| ⏩ Run to Cursor | ⌥F9 | Alt+F9 | Run until the line where cursor is |
| ⏹ Stop | ⌘F2 | Ctrl+F2 | Kill the debug session |
Breakpoints
Click the gutter (the narrow strip left of the line numbers) to set a red breakpoint dot. Click again to remove it. The program will pause just before executing that line.
average < 80. The program only stops when that condition is true — saves time when debugging loops with thousands of iterations.The Variables Panel
When paused at a breakpoint, the Variables panel shows every variable in scope. You can:
- Expand lists, dicts, and objects to see their contents
- Right-click a variable → Set Value to change it live while debugging
- Right-click → Copy Value to grab the current value
Watches & Evaluate Expression
In the Variables panel, click "+" → New Watch". Type any expression like total * 2 or len(scores). It updates automatically at every step.
Press ⌥F8 (Mac) or Alt+F8 (Win) while paused. Type any Python expression — it runs in the current scope. Great for testing a fix without restarting the whole program.
- Use the interactive debugger above — step through all lines
- Set a breakpoint in your own
main.pyand run in debug mode (⌃D) - While paused, add a Watch expression and see it update
- Try Evaluate Expression (⌥F8) to run a quick calculation while paused
The Built-in Terminal
PyCharm has a full terminal emulator built in. The key advantage: it automatically activates your project's virtual environment when it opens. No need to manually run source .venv/bin/activate every time.
Notice the (.venv) prefix — the virtual environment is active. Any pip install here goes into your project's isolated environment.
Open the Terminal
| Action | Mac | Windows/Linux |
|---|---|---|
| Open Terminal | ⌥F12 | Alt+F12 |
| New terminal tab | ⌘T in terminal | Ctrl+Shift+T |
| Close tab | ⌘W | Ctrl+W |
| Split terminal | Right-click tab → Split | Right-click → Split |
Multiple Terminal Tabs
You can open multiple terminal tabs — useful for running a server in one tab and sending requests in another:
python app.py
# server running on http://127.0.0.1:5000
curl http://127.0.0.1:5000/api/data
Python Console vs Terminal
| Terminal | Python Console | |
|---|---|---|
| What it is | Full shell (bash/zsh/PowerShell) | Interactive Python REPL |
| Best for | Running scripts, git, pip, system commands | Exploring objects, testing snippets |
| Opens with venv | ✅ Automatic | ✅ Uses project interpreter |
| Can import your modules | Only if you run python first | ✅ Yes, directly |
| Open via | ⌥F12 | Tools → Python Console |
Changing the Default Shell
Settings → Tools → Terminal → Shell path. Set it to /bin/zsh, /bin/bash, or C:\Program Files\Git\bin\bash.exe on Windows.
- Open the terminal (⌥F12) and verify
(.venv)is shown - Install a package with
pip install requestsin the terminal - Open a second terminal tab and split it
- Open the Python Console and import your installed package
Enable VCS / Connect a Repo
Or open an existing repo: File → Open → select the folder. PyCharm detects .git/ automatically.
Click + and paste your GitHub URL. Name it origin.
https://github.com/your-username/your-repo.git
The Commit Workflow
A panel shows all changed files. Check the ones you want to stage, write a commit message, and press "Commit" or "Commit and Push".
Click any changed file in the panel to see a side-by-side diff right there. Red = removed, green = added. You can even edit directly in the diff view.
A dialog shows the commits about to be pushed and the target branch. Confirm and click Push.
Key Git Actions
| Action | Mac | Windows |
|---|---|---|
| Commit | ⌘K | Ctrl+K |
| Push | ⌘⇧K | Ctrl+Shift+K |
| Pull | ⌘T | Ctrl+T |
| View Git Log | ⌘9 → Log tab | Alt+9 → Log |
| New Branch | Git menu → New Branch | Git → New Branch |
| Annotate (blame) | Right-click gutter → Annotate | Right-click → Annotate |
| Revert file | ⌘⌥Z | Ctrl+Alt+Z |
Resolving Merge Conflicts Visually
When a merge conflict occurs, PyCharm opens a 3-panel merge tool:
Click the → or ← arrows to accept a change from either side into the Result panel. When done, click "Apply". PyCharm marks the conflict as resolved automatically.
Git Log Viewer
Open the Git panel (⌘9 / Alt+9) → click the Log tab. You see the full commit graph, click any commit to inspect changes, filter by author, branch, or date, and right-click to cherry-pick or revert.
- Add a remote GitHub URL via Git → Manage Remotes
- Edit a file, open Commit panel (⌘K), write a message, commit
- Push to GitHub (⌘⇧K) and verify it appears on github.com
- Open the Git Log (⌘9 → Log) and explore the commit history
How It Works
local files
GPU / HPC cluster
PyCharm Run panel
Step 1 — Add SSH Credentials
Click + to add a new SSH connection. Fill in:
| Field | Example |
|---|---|
| Host | hpc.university.edu |
| Port | 22 |
| Username | your_netid |
| Auth type | Key pair (recommended) or Password |
| Private key | ~/.ssh/id_ed25519 |
ssh-keygen -t ed25519 -C "your@email.com"Then copy the public key to the server:
ssh-copy-id username@hpc.university.eduPyCharm will try to SSH into the server. You should see a green "Successfully connected" message. If not, check the host, port, and key path.
Step 2 — Configure the Remote Interpreter
Select the SSH configuration you just created. PyCharm will connect and browse the remote Python installations.
Navigate to the Python path on the remote server, e.g. /usr/bin/python3 or the path to a conda env:
# System Python /usr/bin/python3 # Conda environment on remote /home/username/miniconda3/envs/myenv/bin/python # Module-loaded Python on HPC # First SSH in and run: module load python/3.11 && which python
PyCharm asks where to copy your files on the remote server, e.g. /home/username/projects/my_project. This is where your code will live on the remote.
Running Code Remotely
After setup, just press Run (⌃R) as normal. PyCharm will:
- Sync your local files to the remote server
- Execute the script using the remote Python interpreter
- Stream
stdoutandstderrback to your local Run panel
Install Remote Packages
# PyCharm runs pip install on the REMOTE server for you
ssh username@hpc.university.edu conda activate myenv pip install torch torchvision
- Add SSH credentials in Settings → Tools → SSH Configurations
- Test the connection successfully
- Add remote interpreter via Settings → Python Interpreter → On SSH
- Run a simple script and see its output in the local PyCharm Run panel
Deployment (this module) = a dedicated SFTP server configuration that gives you manual and automatic control over file sync — including upload on save, selective sync, and a visual remote file browser.
How Local ↔ Remote Mapping Works
💻 Local (Your Laptop)
🖥️ Remote Server
Step 1 — Configure a Deployment Server
Click + → SFTP. Give it a name (e.g., "My Remote Server"). Fill in the Connection tab:
| Field | Example |
|---|---|
| SSH Configuration | Select the one from Module 6 |
| Root path | /home/your_netid/projects |
Step 2 — Set Path Mappings
Add a mapping that tells PyCharm which local folder corresponds to which remote folder:
| Local Path | Deployment Path |
|---|---|
| /Users/you/projects/my_project | /home/netid/projects/my_project |
| /Users/you/projects/my_project/data | /scratch/netid/data |
You can have multiple mappings — for example, your main code folder maps to your home directory, but a large data folder maps to a scratch/data partition on the server.
Step 3 — Configure Excluded Paths
Add any paths you do NOT want to upload to the server:
.venv/ # local venv — remote has its own __pycache__/ .git/ *.local.py # local-only config files .DS_Store
Upload Options
| Method | How | When to use |
|---|---|---|
| Manual upload | Right-click file → Deployment → Upload to … | One-off uploads |
| Upload all | Tools → Deployment → Upload to … | Initial sync of whole project |
| Auto-upload on save | Tools → Deployment → Options → Upload on explicit save | Active development on remote |
| Sync (compare) | Tools → Deployment → Sync with Deployed … | Check what differs before syncing |
Remote File Browser
Go to Tools → Deployment → Browse Remote Host. A panel opens showing the remote file system:
From this browser you can:
- Double-click any file to open and edit it directly (changes save back to the server)
- Right-click → Download to pull files to local
- Right-click → Delete, Rename, New File/Directory
- Drag files between local Project panel and Remote Files panel
Compare Local vs Remote
Right-click any local file → Deployment → Compare with Deployed Version. PyCharm shows a diff of the local file vs what's currently on the server — useful to confirm you haven't forgotten to upload something.
- Add a Deployment server in Settings → Deployment → + → SFTP
- Set a path mapping: local project folder → remote home folder
- Right-click a Python file → Deployment → Upload — verify it appears on the server
- Open Tools → Deployment → Browse Remote Host and explore the file tree
- Edit a remote file directly and watch changes save back to the server
| Run file | ⌃R / Shift+F10 |
| Debug file | ⌃D / Shift+F9 |
| Step Over | F8 |
| Step Into | F7 |
| Step Out | ⇧F8 / Shift+F8 |
| Resume program | ⌘⌥R / F9 |
| Evaluate expression | ⌥F8 / Alt+F8 |
| Toggle breakpoint | ⌘F8 / Ctrl+F8 |
| Stop | ⌘F2 / Ctrl+F2 |
| Search Everywhere | ⇧⇧ / Shift+Shift |
| Go to file | ⌘⇧O / Ctrl+Shift+N |
| Go to class | ⌘O / Ctrl+N |
| Go to symbol | ⌘⌥O / Ctrl+Alt+Shift+N |
| Go to definition | ⌘B / Ctrl+B |
| Find usages | ⌥F7 / Alt+F7 |
| Go to line | ⌘L / Ctrl+G |
| Back / Forward | ⌘[ / ⌘] / Ctrl+Alt+←/→ |
| Recent files | ⌘E / Ctrl+E |
| Auto-complete | ⌃Space / Ctrl+Space |
| Reformat code | ⌘⌥L / Ctrl+Alt+L |
| Comment line | ⌘/ / Ctrl+/ |
| Duplicate line | ⌘D / Ctrl+D |
| Delete line | ⌘⌫ / Ctrl+Y |
| Move line up/down | ⇧⌘↑/↓ / Shift+Alt+↑/↓ |
| Rename (refactor) | ⇧F6 |
| Surround with | ⌘⌥T / Ctrl+Alt+T |
| Quick fix | ⌥↩ / Alt+Enter |
| Commit | ⌘K / Ctrl+K |
| Push | ⌘⇧K / Ctrl+Shift+K |
| Pull | ⌘T / Ctrl+T |
| Git log | ⌘9 → Log / Alt+9 |
| Annotate (blame) | Gutter right-click |
| Revert file | ⌘⌥Z / Ctrl+Alt+Z |
| Compare with branch | Git → Compare with Branch |
| Project panel | ⌘1 / Alt+1 |
| Bookmarks | ⌘2 / Alt+2 |
| Run panel | ⌘4 / Alt+4 |
| Debug panel | ⌘5 / Alt+5 |
| Git panel | ⌘9 / Alt+9 |
| Terminal | ⌥F12 / Alt+F12 |
| Python console | Tools → Python Console |
| Settings | ⌘, / Ctrl+Alt+S |
| Hide all panels | ⇧⌘F12 / Ctrl+Shift+F12 |
| Find in file | ⌘F / Ctrl+F |
| Replace in file | ⌘R / Ctrl+R |
| Find in project | ⌘⇧F / Ctrl+Shift+F |
| Replace in project | ⌘⇧R / Ctrl+Shift+R |
| Next occurrence | ⌘G / F3 |
| Highlight usages | ⌘⇧F7 / Ctrl+Shift+F7 |