-
Notifications
You must be signed in to change notification settings - Fork 92
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
Check for ipykernel
in New Project Wizard
#2847
Conversation
also use the ipykernel check in the python environment substep description/feedback
This reverts commit 5774676.
This command checks if the interpreter corresponding to the provided Python path has a compatible ipykernel installed.
Instead of a function that returns either an element or string, pass the element or string directly for the PositronWizardSubStepProps description and feedback properties.
I don't know if I've got a broken Python environment but the one that I currently use for testing receives the message that ipykernel will be installed. Oddly, an existing Homebrew install (same Python version) does not show the message. Screen.Recording.2024-04-22.at.5.16.28.PM.mov |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Python extension changes LGTM!
Use the pythonPath from the extraRuntimeData if it exists, otherwise use the runtimePath. In particular, the pythonPath is needed to check if ipykernel is installed for Pyenv environments (the runtimePath results in an error, although the pythonPath works fine, seemingly because the runtimePath is aliased, i.e. starts with `~`). In many cases, the pythonPath and runtimePath are the same. When they differ, it seems that the pythonPath is the non-aliased path to the python interpreter.
Ah thanks for catching this! I wasn't using Pyenv previously, but I was able to reproduce this issue after setting Pyenv up and using Positron's modal prompt to install ipykernel, then selecting my Pyenv Python interpreter in the wizard. The issue seems to be that the Using the Do you mind checking again to see if the issue is still happening for you? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It worked for me! I did have to eventually restart VS Code before launching a dev Positron. It seemed to not picked up any new environments that I created with pyenv cli until I did that.
Awesome! For the new environments created not getting picked, I'll have to look into whether that's because the registered runtimes in the runtime service only gets updated during startup (which will require a reload of the IDE) or maybe I need to add another listener for registered runtimes. Alternatively, I could add a "refresh" button so the user can manually refresh the interpreter dropdown list. |
Intent
ipykernel
is installed for the selected interpreter #2856proj_wiz_check_for_ipykernel.mp4
Approach
python.isIpykernelInstalled
to the python extensionipykernel
will be installed when a new environment is being createdipykernel
will be installed if the selected interpreter doesn't have ipykernel is installedNext
button not maintaining disabled stylingQA Notes
Does not include installing
ipykernel
during project creation. This will be added in a future PR.