Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to set the Python Interpreter automatically with Pycharm #524

Open
Calcagiara opened this issue Jan 22, 2025 · 1 comment
Open

Unable to set the Python Interpreter automatically with Pycharm #524

Calcagiara opened this issue Jan 22, 2025 · 1 comment

Comments

@Calcagiara
Copy link

I'm currently using the jetbrains module in a jupyter workspace on coder, with the aim of working remotely with my PyCharm installation.
Although I am able to connect to the workspace, I cannot set the correct Python Interpreter automatically when starting the remote session with PyCharm.

By default, PyCharm was searching in usr/bin/python3.10, which is not the correct path, so I've set the following environment variables in the jupyter template for the location of the interpreter:

env {
  name  = "PYCHARM_PYTHON_PATH"
  value = "/opt/conda/bin/python3.10"
}
env {
  name  = "PYTHONPATH"
  value = "/opt/conda/bin/python3.10"
}

With this change, the right interpreter gets found, BUT it doesn't get set, as I receive a message "No Python interpreter configured for the project".

Image

As you can see from the screenshot, the interpreter is not configured, but in the bottom right it is indeed found and, once I set it manually, everything works as expected.

What I want to archieve is to set it automatically when starting the session, because not everyone is aware that they should set the interpreter manually and a user may think there is something wrong. Furthermore, the warning message from PyCharm suggests the wrong path for the interpreter (I guess it uses the default one).

Is there a way to achieve this goal? Am I doing something wrong or is this scenario not supported?

Thanks in advance.

@coder-labeler coder-labeler bot added the question Further information is requested label Jan 22, 2025
@matifali
Copy link
Member

Sorry for not coming to this early. It was, for some reason, overlooked.
Can you get it right when connecting directly via SSH to coder.<workspace-name>?

@matifali matifali added waiting-for-info and removed question Further information is requested labels Mar 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants