intellij icon indicating copy to clipboard operation
intellij copied to clipboard

Invalid Python SDK error on Clion 2024.2

Open anonrig opened this issue 1 year ago • 10 comments

Description of the bug:

Whenever I press Sync button on Clion:

Screenshot 2024-08-16 at 7 33 34 AM

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

anonrig avatar Aug 16 '24 11:08 anonrig

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?

tpasternak avatar Aug 16 '24 13:08 tpasternak

Setting it doesn’t fix. It overrides the selected value to unresolved item with reference to /usr/bin/indent whenever I press sync

anonrig avatar Aug 16 '24 13:08 anonrig

Seems to by a Python plugin issue, I'll let you know about the progress

tpasternak avatar Aug 16 '24 16:08 tpasternak

~~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~~

tpasternak avatar Aug 16 '24 17:08 tpasternak

Running into the exact same issue, just installed clion and the bazel plugin and getting this error.

Olle-Lukowski avatar Aug 20 '24 11:08 Olle-Lukowski

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

sudarshanraorobinhood avatar Aug 23 '24 02:08 sudarshanraorobinhood

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.

tpasternak avatar Aug 23 '24 05:08 tpasternak

Hello there, This problem is related to this bug. As a temporary workaround please do the following:

  1. Open Help | Find Action.
  2. Type "boot runtime".
  3. Open "Choose Boot Java Runtime for the IDE".
  4. Select JBR 17 bundled with the IDE.
  5. Restart IDE.

DaniilBogdanovJB avatar Aug 23 '24 08:08 DaniilBogdanovJB

Fixed in JetBrains IDEs v2024.2.1

tpasternak avatar Sep 02 '24 14:09 tpasternak

Reproduced in PyCharm 2024.2.3

p.s. rolling back to 2024.2.1 did fix the issue

zw0610 avatar Oct 15 '24 11:10 zw0610

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.

Screenshot 2024-10-24 at 17 41 38

cdeil avatar Oct 24 '24 15:10 cdeil

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=

Screenshot 2024-10-24 at 17 48 47

cdeil avatar Oct 24 '24 15:10 cdeil

Fixing the /usr/bin/indent Interpreter Issue in Clion/PyCharm

Steps to Resolve the Issue

  1. Close IDE
    Ensure IDE is completely closed before making changes.

  2. 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.
  3. Go to the "options" Folder
    Within the configuration directory, open the folder named options.

  4. Open the jdk.table.xml File

    • Locate jdk.table.xml in the options folder.
    • Open it with a text editor.
  5. Edit the Interpreter Path

    • Look for the line:
      <homePath value="/usr/bin/indent" />
      
    • Change it to:
      <homePath value="/usr/bin/python3" />
      
    • Save the file.
  6. 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.

voskobovich avatar Oct 28 '24 11:10 voskobovich

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.

sellophane avatar Oct 28 '24 14:10 sellophane

Closing as obsolete

ujohnny avatar May 22 '25 09:05 ujohnny