Problem
When attempting to add a Python virtual environment in PyCharm 2026.1 on Windows 11 with WSL 2.0 (Ubuntu 24.04 distribution), the UI gets stuck at "loading environments" indefinitely. Additionally, existing virtual environments are marked as invalid Python SDKs, with errors indicating "unexpected EOF while looking for matching quote".
Cause
The issue is caused by quoting errors in the WSL shell startup files (e.g., ~/.bashrc, ~/.bash_profile, ~/.profile) or the presence of output/redirecting commands (like neofetch, echo, or similar) in these files. This disrupts the command PyCharm runs to scan for environments in WSL, leading to infinite loading and invalid SDK states.
Resolution
-
Upgrade PyCharm: Ensure PyCharm 2026.1.3 or higher is installed.
-
Reset
jdk.table.xml:- Close PyCharm.
- Navigate to the configuration directory (e.g.,
%APPDATA%\JetBrains\PyCharm<version>\options). - Rename
jdk.table.xmltojdk.table.backup.xmlto create a backup. - Restart PyCharm to regenerate the
jdk.table.xmlfile and clear interpreters.
-
Inspect and Fix WSL Startup Files:
- Run syntax checks for startup scripts:
Any file reporting "unexpected EOF while looking for matching" contains unmatched quotes that must be corrected.bash -n ~/.bashrc bash -n ~/.bash_profile bash -n ~/.profile - Test for unnecessary output:
The output should only consist ofbash -lc 'echo ===START===; echo ===END=== '===START===and===END===. If extra text appears, locate and comment/remove commands likeneofetch,fortune, orechowithin the startup files.
- Run syntax checks for startup scripts:
-
Validate Changes:
- Retry adding the virtual environment in PyCharm.
If issues persist, provide updated IDE logs for further analysis.
Comments
0 comments
Please sign in to leave a comment.