使用Anaconda环境时PyCharm调试报错求助
Hey Barak, sorry to hear you're stuck with this debugging error—exit code -1073741819 (0xC0000005) is a memory access violation, which usually stems from compatibility issues between PyCharm's debugger, your Anaconda environment, or system settings. Let's go through actionable fixes to get your debugger working:
1. Upgrade PyCharm to the Latest Version
Your current PyCharm version (2018.1.2) is quite outdated. Newer versions include an updated pydevd (the underlying debugger tool) that’s far more compatible with modern Anaconda and TensorFlow environments. Head to JetBrains’ official site to download the latest Community Edition, install it, and reconfigure your tfenv environment in the new setup.
2. Reinstall/Update Pydevd in Your Anaconda Environment
Mismatched versions of the pydevd package between PyCharm’s built-in tools and your environment can trigger conflicts. Run these commands in your Anaconda prompt (after activating tfenv):
conda activate tfenv pip install --upgrade pydevd # If pip fails, try conda instead conda install -c conda-forge pydevd
3. Adjust PyCharm Debugger Compatibility Settings
Tweak these settings to resolve process attachment or compatibility glitches:
- Open File > Settings > Build, Execution, Deployment > Debugger > Python Debugger
- Toggle the Gevent compatible checkbox (enable if disabled, disable if enabled)
- Uncheck Attach to subprocess automatically—even empty scripts might trigger subprocess checks that cause this error
- Click Apply and restart PyCharm before testing the debugger again
4. Verify Python-TensorFlow Version Compatibility
Make sure your environment’s Python and TensorFlow versions are fully compatible. For example:
- TensorFlow 2.10+ supports Python 3.7–3.10
- Older TensorFlow versions have stricter Python version limits
Check your versions with these commands in your activated environment:
python --version pip show tensorflow
If versions are mismatched, recreate your Anaconda environment with a compatible Python version and reinstall TensorFlow.
5. Exclude PyCharm/Anaconda Directories from Antivirus
Windows Defender or third-party antivirus tools often flag pydevd.py (the debugger process) as suspicious, blocking its memory access. Try:
- Temporarily disabling real-time protection
- If debugging works after disabling, add these directories to your antivirus whitelist:
- Your PyCharm installation folder (
C:\Program Files\JetBrains\PyCharm Community Edition...) - Your Anaconda environment folder (
C:\Users\Barak\Anaconda3\envs\tfenv)
- Your PyCharm installation folder (
6. Reset PyCharm Debugger Configuration
Corrupted debugger config files can cause unexpected errors:
- Close PyCharm completely
- Navigate to your PyCharm config directory (for 2018.1.2, it’s
C:\Users\Barak\.PyCharmCE2018.1) - Delete the
config\options\debugger.xmlfile - Restart PyCharm—it will regenerate a fresh debugger configuration
Start with upgrading PyCharm first, as outdated versions are the most common culprit for this specific error. If that doesn’t resolve it, work through the other steps one by one.
内容的提问来源于stack exchange,提问作者BarakB

