
TL;DR:
- The error is usually caused by corrupted lock files in the
system/cache, not your settings. - Don’t delete the entire JetBrains folder—rename
system/first; PyCharm will regenerate clean caches. - If needed, try killing zombie processes or freeing the IDE port before considering the nuclear option.
You start PyCharm and get hit with the message “Cannot connect to already running IDE instance.” The common advice is to delete your entire JetBrains folder, but that wipes keymaps, themes, plugins, and months of customization. There’s a faster, safer fix that preserves your settings.
How to properly configure your Python development environment →
Rename the problematic JetBrains folder to fix PyCharm without losing settings
Why This Error Happens (And Why the Common Fix Is Garbage)
PyCharm uses lock files and port tokens to prevent multiple instances. If the IDE crashes or is force-quit, stale lock files can remain and block startup. The fix isn’t deleting your entire profile—it’s removing the corrupted cache.

On macOS, the path often looks like ~/Library/Application Support/JetBrains/PyCharmCE2023.2/. Inside, you’ll see subfolders:
- config/ – Settings, keymaps, themes, inspection profiles
- system/ – Caches, indexes, and lock files (the usual culprit)
- plugins/ – Installed plugins
- log/ – Diagnostic logs
Nuking the whole version folder “works,” but it’s overkill. It forces you to rebuild configuration, reinstall plugins, recreate keymaps, and redo interpreters—just to fix one bad cache.

The Surgical Fix: Isolate the Problem Without Losing Everything
Step 1: Get to the Hidden JetBrains Folder
Mac: ~/Library/Application Support/JetBrains/ (use Finder → Go → hold Option → Library, or Cmd+Shift+G and paste the path)
Windows: C:\Users\[USERNAME]\AppData\Roaming\JetBrains\PyCharmCE2023.2 (enable hidden items in File Explorer)
Linux: ~/.config/JetBrains/PyCharmCE2023.2/ (enable “Show Hidden Files” in your file manager)
Step 2: Rename Subfolders to Test
- Quit PyCharm completely.
- Rename system/ to system-OLD.
- Launch PyCharm. If it starts, you’ve found the culprit. PyCharm rebuilds system/ automatically.
- If the error persists, revert and try renaming plugins/, then config/ (rarely the issue).
Common offenders include port.lock and token files in system/. Crashes leave them orphaned.
Step 3: Check That Everything Works
- Recent projects should appear and your settings remain intact (as long as you didn’t rename config/).
- Indexes will rebuild once; performance returns after this initial pass.
- After confirming, you can delete system-OLD (it’s just cache).

Good to know…
Each JetBrains IDE (IntelliJ, WebStorm, PyCharm) maintains separate configuration folders. Fixing or deleting PyCharm’s cache/config won’t affect your other JetBrains tools.
Alternative Approaches (When Renaming Isn’t Enough)
Kill Zombie Processes
Mac/Linux: find with ps aux | grep pycharm and kill with kill -9 [PID]. Windows: use Task Manager (Ctrl+Shift+Esc) → Details tab → End Task.
Release the Port Manually
PyCharm may use ports 6942 or 63342. Check with lsof -i :6942 or lsof -i :63342 and kill the offending PID if it isn’t PyCharm.
The Official Nuclear Option
If nothing works: try File → Invalidate Caches (if you can launch in safe mode). Otherwise, export settings (File → Manage IDE Settings → Export Settings), then delete the entire version folder. You’ll keep settings if you reimport, but plugins and interpreters may need reconfiguration.
| Method | Preserves Settings? | Effort Required | Success Rate |
|---|---|---|---|
| Rename system/ folder | ✅ Yes | Low | Common |
| Kill zombie processes | ✅ Yes | Low | Moderate |
| Release port manually | ✅ Yes | Medium | Less Common |
| Delete entire folder | ❌ No | Medium | 100% |

Warning…
If you recently updated macOS, app permissions may have changed. If the error resurfaces, check System Settings → Privacy & Security → Full Disk Access and ensure PyCharm is allowed.
Do’s
- Rename system/ first to regenerate clean caches.
- Export settings or enable Settings Sync before any risky changes.
Don’ts
- Don’t delete the entire JetBrains version folder unless all else fails.
- Don’t force-quit PyCharm repeatedly; close it properly to avoid stale locks.
Preventing This From Happening Again
- Close PyCharm via File → Exit (or PyCharm → Quit on Mac) to clean up locks.
- Enable Settings Sync: Settings → Settings Sync → Enable, so your configuration is backed up.
- Export settings after major changes: File → Manage IDE Settings → Export Settings.
- Keep old version folders briefly after upgrades; delete once stable.
- After macOS updates, recheck Full Disk Access if issues reappear.

Frequently asked questions (FAQ)
Yes, but renaming the entire system/ folder is quicker and more thorough. PyCharm regenerates clean caches and any other corrupted files you might miss.
Yes. The same folder structure and lock-file mechanism apply to all JetBrains IDEs. Replace “PyCharm” with your IDE’s name in the path.
Bottom Line
This error is usually a corrupted cache in system/. Rename that folder, let PyCharm rebuild it, and you’re back up in minutes—with your config and plugins intact. Escalate only if necessary.
Sources and references
- JetBrains Docs: Directories used by the IDE
- JetBrains Support: Cannot connect to already running IDE instance
- Stack Overflow: PyCharm cannot connect to already running IDE instance
- YouTrack: IDEA-246860
- Reddit r/PyCharm discussions
- JetBrains Developer Ecosystem Survey 2023
- Apple Support: Show hidden files on Mac
- JetBrains Docs: Sharing IDE settings






