Invalid Python SDK error on Clion 2024.2
Description of the bug:
Whenever I press Sync button on Clion:
Which category does this issue belong to?
Intellij
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
- git clone GitHub.com/cloudflare/workerd
- install bazelisk using brew install bazelisk
- install bazel clion plugin
- open project in clion
- sync
Which Intellij IDE are you using? Please provide the specific version.
Clion 2024.2
What programming languages and tools are you using? Please provide specific versions.
python, js, ts, c++
What Bazel plugin version are you using?
latest
Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
No response
I can't reproduce it. As a workaround, could you please go to settings -> "Python Interpreter" and set the interpreter manually for the .workspace module?
Setting it doesn’t fix. It overrides the selected value to unresolved item with reference to /usr/bin/indent whenever I press sync
Seems to by a Python plugin issue, I'll let you know about the progress
~~If you did it manually, I'd recommend to uninstall it and install again ensuring it's the right one - we publish both 2024.1-compatible version, as well as 2024.2 one~~
Running into the exact same issue, just installed clion and the bazel plugin and getting this error.
I use Goland and the Bazel Plugin and facing the same issue. This happens whenever I use the Bazel plugin to Sync Project with BUILD Files. Every time I sync, Goland also unmarks all my python directories that were marked previously as sources root and I have to remark them again which is very annoying.
Goland version details
GoLand 2024.2.0.1
Build #GO-242.20224.424, built on August 20, 2024
Licensed to Robinhood Markets Inc. / Sudarshan Rao
Subscription is active until January 4, 2025.
Runtime version: 21.0.3+13-b509.4 aarch64 (JCEF 122.1.9)
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Toolkit: sun.lwawt.macosx.LWCToolkit
macOS 14.6.1
GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation
Memory: 4096M
Cores: 12
Metal Rendering is ON
Registry:
ide.completion.variant.limit=500
suggest.all.run.configurations.from.context=true
ide.experimental.ui=true
Non-Bundled Plugins:
org.toml.lang (242.20224.155)
PythonCore (242.20224.300)
org.mvnsearch.plugins.justPlugin (0.5.1)
com.github.copilot (1.5.20.6554)
com.google.idea.bazel.ijwb (2024.07.30.0.2-api-version-242)
Bazel plugin version: 2024.07.30.0.2-api-version-242
So unfortunately the safest workaround is to switch to GoLand/PyCharm/CLion 2024.1 for a while. The fix to 2024.2 is on its way, too.
Hello there, This problem is related to this bug. As a temporary workaround please do the following:
- Open Help | Find Action.
- Type "boot runtime".
- Open "Choose Boot Java Runtime for the IDE".
- Select JBR 17 bundled with the IDE.
- Restart IDE.
Fixed in JetBrains IDEs v2024.2.1
Reproduced in PyCharm 2024.2.3
p.s. rolling back to 2024.2.1 did fix the issue
I still get this error in PyCharm Professional 2024.2.4.
This is on MacOS with Python 3.13 installed via Homebrew.
But also any other project also with other Python interpreters (e.g. from conda) don't work.
I see this issue is still open, so I assume you're working on it and a fix is coming in a future release.
I'll roll back to older PyCharm for now.
With latest EAP this error related to /usr/bin/indent shows when selecting system Python 3.9 interpreter.
PyCharm 2024.3 EAP (Professional Edition) Build #PY-243.20847.48, built on October 21, 2024 Licensed to PyCharm EAP user: Christoph Deil Expiration date: November 20, 2024 Runtime version: 21.0.4+8-b631.2 aarch64 (JCEF 122.1.9) VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. Toolkit: sun.lwawt.macosx.LWCToolkit macOS 15.0.1 GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation Memory: 2048M Cores: 8 Metal Rendering is ON Registry: ide.experimental.ui=true i18n.locale=
Fixing the /usr/bin/indent Interpreter Issue in Clion/PyCharm
Steps to Resolve the Issue
-
Close IDE
Ensure IDE is completely closed before making changes. -
Navigate to the Config Directory
- Go to the configuration directory specific to your IDE version.
- Find the correct path based on your operating system from this documentation.
-
Go to the "options" Folder
Within the configuration directory, open the folder namedoptions. -
Open the
jdk.table.xmlFile- Locate
jdk.table.xmlin theoptionsfolder. - Open it with a text editor.
- Locate
-
Edit the Interpreter Path
- Look for the line:
<homePath value="/usr/bin/indent" /> - Change it to:
<homePath value="/usr/bin/python3" /> - Save the file.
- Look for the line:
-
Reopen IDE
Launch IDE and verify the interpreter path now correctly points to Python (/usr/bin/python3) instead of/usr/bin/indent.
This should resolve the issue, allowing you to use PyCharm with the correct Python interpreter without any indent errors.
If the incorrect interpreter is still set, replace /usr/bin/indent with /usr/bin/python3 in the .idea directory files, or consider removing this folder entirely.
I was able to reproduce the issue with 2024.2.4, but not with the 2024.3 EAP (the latest EAP being 243.21155.22). The fix will probably be included in 2024.2.5, which will land around the same time as released 2024.3.
Closing as obsolete