-
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
python: hide unsupported Python versions from interpreter dropdown #3740
Comments
Thanks for the kind words and interest @Vinnish-A ! We currently support Python 3.8 to 3.12 as seen in the Wiki: https://github.com/posit-dev/positron/wiki#python-prerequisites -- that may be the specific issue you are facing right now. |
Thank you for the kind words and for the feedback! As Tom mentioned, we only support Python >= 3.8. If you were able to select a Python 3.6 interpreter, that is actually a bug! Could you please share more about your Python 3.6 environment? How was it installed (homebrew, conda, etc), and was it a virtual environment? We could also include the minimum IPyKernel version in the prompt to install/upgrade it. |
Of course, I am very willing to report to you the specific situation during the use process. First of all, it's very strange that yesterday I could still automatically find and select the Python 3.6.2 interpreter installed in a conda environment through the button in the top right corner of Positron. However, when I tried to reproduce this issue today, Python 3.6.2 no longer appears in the options for automatic search. Although I can currently find it by setting the Python 3.6.2 as the default interpreter in settings, due to the lack of a suitable IPyKernel, Python will fail to start, which means it cannot be used. This is strange because I am sure that yesterday I did run a program in an ipynb file using this Python 3.6.2 , as I only configured Keras in this version of Python. But no matter what, this problem seems like it shouldn't have occurred, but now it's gone, hopefully we can encounter it again in the future. |
Glad it's sorted for now. Is it possible that you had set Python 3.6.2 as the default interpreter in settings the first time too, and that caused it to show in the select interpreter menu? |
Let's double check that:
|
On the first point, I installed Python 3.6.15 using pyenv and Positron did show it as an interpreter and tried to offer to install ipykernel. It eventually fails: On the second point of errors not explaining what version of ipykernel is needed... while we do try to install a later ipykernel if the version is
It should attempt to stop the old interpreter, successfully install ipykernel when prompted, and start the new interpreter. |
I just tried to reproduce the failure cases mentioned:
No longer occurs. If an incorrect
Is still happening, and needs to be fixed. Going to rename this issue so the goals are more clear here! |
### Release Notes <!-- Optionally, replace `N/A` with text to be included in the next release notes. The `N/A` bullets are ignored. If you refer to one or more Positron issues, these issues are used to collect information about the feature or bugfix, such as the relevant language pack as determined by Github labels of type `lang: `. The note will automatically be tagged with the language. These notes are typically filled by the Positron team. If you are an external contributor, you may ignore this section. --> #### New Features - N/A #### Bug Fixes - #3740 filters out unsupported (<3.8) Python versions from the `Python: Select Interpreter` dropdown ### QA Notes 1. create a Python interpreter <3.8 (if you are a pyenv user, you can do `pyenv install 3.6`) 2. go to `Python: Select Interpreter` 3. should not appear in dropdown
…ettings (#6398) ### Summary - addresses #3574 for both the JS and native locators - also implements #6254 for the JS locator (previously [only implemented for the native locator](#6261)) - introduces new settings - `python.interpreters.include`: List of folders to search for Python installations. These folders are searched in addition to the default folders for your operating system. - `python.interpreters.exclude`: List of interpreter paths or folders to exclude from the available Python installations. These interpreters will not be displayed in the Positron UI. This option takes precedence over the `include` option. - adds new command available via Command Palette: `python.interpreters.debugInfo`: "Print interpreter debug information to Output" - Opens the Python Language Pack Output and prints python interpreter settings info as well as info about each discovered python runtime #### Settings UI <img width="1020" alt="image" src="https://github.com/user-attachments/assets/137d7798-50c8-4668-9444-db9917e91417" /> #### Settings JSON ```json "python.interpreters.include": [ "~/scratch" ], "python.interpreters.exclude": [ "/usr/bin/python3", "/opt/homebrew", "/usr/local/bin", "/opt/python", "~/scratch" ] ``` #### Python Language Pack Output Some log prefixes/messages to search for: - `pythonRuntimeDiscoverer`: to find out if any runtimes were filtered out during discovery - `shouldIncludeInterpreter`: whether or not the interpreter will be included based on the user settings - `Not registering runtime ${extraData.pythonPath} as it is excluded via user settings.`: if the runtime is not getting registered because the user excluded it - `getAdditionalEnvDirs`: native python finder -- list all the additional directories being searched, such as the user-included dirs <details><summary>Sample Output from `python.interpreters.debugInfo`: "Print interpreter debug information to Output"</summary> ```js 2025-02-24 10:43:17.026 [info] ===================================================================== 2025-02-24 10:43:17.026 [info] =============== [START] PYTHON INTERPRETER DEBUG INFO =============== 2025-02-24 10:43:17.026 [info] ===================================================================== 2025-02-24 10:43:17.026 [info] Python interpreter settings: { defaultInterpreterPath: '/Users/hello/qa-example-content/.venv/bin/python', 'interpreters.include': [ '/Users/hello/scratch' ], 'interpreters.exclude': [ '/usr/bin/python3', '/opt/homebrew', '/usr/local/bin', '/opt/python', '/Users/hello/scratch' ] } 2025-02-24 10:43:17.026 [info] Python interpreters discovered: [ { name: 'Python 3.13.1 64-bit', path: '/opt/homebrew/bin/python3', versionInfo: { version: '3.13.1', supportedVersion: true }, envInfo: { envType: 'Global', envName: '' }, enablementInfo: { visibleInUI: false, includedInSettings: false, excludedInSettings: true } }, { name: 'Python 3.10.4 64-bit', path: '/opt/python/3.10.4/bin/python', versionInfo: { version: '3.10.4', supportedVersion: true }, envInfo: { envType: 'Unknown', envName: '' }, enablementInfo: { visibleInUI: false, includedInSettings: false, excludedInSettings: true } }, { name: "Python 3.12.2 64-bit ('3.12.2': pyenv)", path: '/Users/hello/.pyenv/versions/3.12.2/bin/python', versionInfo: { version: '3.12.2', supportedVersion: true }, envInfo: { envType: 'Pyenv', envName: '3.12.2' }, enablementInfo: { visibleInUI: true, includedInSettings: false, excludedInSettings: false } }, { name: "Python 3.6.15 64-bit ('3.6.15': pyenv)", path: '/Users/hello/.pyenv/versions/3.6.15/bin/python', versionInfo: { version: '3.6.15', supportedVersion: false }, envInfo: { envType: 'Pyenv', envName: '3.6.15' }, enablementInfo: { visibleInUI: true, includedInSettings: false, excludedInSettings: false } }, { name: "Python 3.10.4 ('.venv': venv)", path: '/Users/hello/qa-example-content/.venv/bin/python', versionInfo: { version: '3.10.4', supportedVersion: true }, envInfo: { envType: 'Venv', envName: '.venv' }, enablementInfo: { visibleInUI: true, includedInSettings: false, excludedInSettings: false } }, { name: 'Python 3.10.4 64-bit (custom)', path: '/Users/hello/scratch/3.10.4/bin/python', versionInfo: { version: '3.10.4', supportedVersion: true }, envInfo: { envType: 'Unknown', envName: '' }, enablementInfo: { visibleInUI: false, includedInSettings: true, excludedInSettings: true } }, { name: 'Python 3.9.6 64-bit', path: '/usr/bin/python3', versionInfo: { version: '3.9.6', supportedVersion: true }, envInfo: { envType: 'Global', envName: '' }, enablementInfo: { visibleInUI: false, includedInSettings: false, excludedInSettings: true } }, { name: 'Python 3.10.4 64-bit', path: '/usr/local/bin/python3', versionInfo: { version: '3.10.4', supportedVersion: true }, envInfo: { envType: 'Global', envName: '' }, enablementInfo: { visibleInUI: false, includedInSettings: false, excludedInSettings: true } }, { name: 'Python 3.11.6 64-bit', path: '/usr/local/bin/python3.11', versionInfo: { version: '3.11.6', supportedVersion: true }, envInfo: { envType: 'Global', envName: '' }, enablementInfo: { visibleInUI: false, includedInSettings: false, excludedInSettings: true } } ] 2025-02-24 10:43:17.026 [info] ===================================================================== 2025-02-24 10:43:17.026 [info] ================ [END] PYTHON INTERPRETER DEBUG INFO ================ 2025-02-24 10:43:17.026 [info] ===================================================================== ``` </details> ### Release Notes #### New Features - New settings to include additional Python interpreter search directories or exclude Python interpreters from the UI (#3574) #### Bug Fixes - filters out unsupported (<3.8) Python versions from the `Python: Select Interpreter` dropdown (#3740) @isabelizimm ### QA Notes - Please verify these options using both the JS and Native locators. Toggle between the locators by updating setting `python.locator`. - Positron will need to be restarted upon changing the `python.interpreters.include`/`python.interpreters.exclude` settings so that discovery can re-run with the settings applied - If an interpreter path is captured in both options, it will be excluded - If a user has a python install they want to include at path `/1/2/3/4/5/3.10.4/bin/python`, they should use `/1/2/3/4/5` or `/1/2/3/4/5/3.10.4` as the included directory. - Windows users can specify paths with either path separator - Relative paths specified in the options are ignored - If a user starts an interpreter, then excludes or un-includes it and restarts Positron, it will still be selected upon restart - if they shut it down and then restart, it should no longer show --------- Co-authored-by: Isabel Zimmerman <[email protected]>
Oh no! 😞 Here is code that should be filtering out <3.8 in the Positron interpreter dropdown. It does seem to be filtering if you step through this code/look at logs, so it must be repopulating somewhere else. Unsupported versions are successfully filtered in the |
@isabelizimm We also register runtimes when certain interpreter-related events fire. We might not be filtering there. |
ah yes I encountered this when working on the includes/excludes here: positron/extensions/positron-python/src/client/positron/manager.ts Lines 112 to 127 in 1c0e6ca
|
Should block <3.8 interpreters from being registered when found. It seems to fix everything for me locally, I think this is the only place where old interpreters could sneak by. ### Release Notes <!-- Optionally, replace `N/A` with text to be included in the next release notes. The `N/A` bullets are ignored. If you refer to one or more Positron issues, these issues are used to collect information about the feature or bugfix, such as the relevant language pack as determined by Github labels of type `lang: `. The note will automatically be tagged with the language. These notes are typically filled by the Positron team. If you are an external contributor, you may ignore this section. --> #### New Features - N/A #### Bug Fixes - #3740 ### QA Notes 1. Create a Python interpreter <3.8 (if you are a pyenv user, you can do pyenv install 3.6) 2. Fo to `Python: Select Interpreter`, should not appear in dropdown 3. Go to Positron interpreter selector, should not appear here either
Should block <3.8 interpreters from being registered when found. It seems to fix everything for me locally, I think this is the only place where old interpreters could sneak by. ### Release Notes <!-- Optionally, replace `N/A` with text to be included in the next release notes. The `N/A` bullets are ignored. If you refer to one or more Positron issues, these issues are used to collect information about the feature or bugfix, such as the relevant language pack as determined by Github labels of type `lang: `. The note will automatically be tagged with the language. These notes are typically filled by the Positron team. If you are an external contributor, you may ignore this section. --> #### New Features - N/A #### Bug Fixes - #3740 ### QA Notes 1. Create a Python interpreter <3.8 (if you are a pyenv user, you can do pyenv install 3.6) 2. Fo to `Python: Select Interpreter`, should not appear in dropdown 3. Go to Positron interpreter selector, should not appear here either
Should block <3.8 interpreters from being registered when found. It seems to fix everything for me locally, I think this is the only place where old interpreters could sneak by. ### Release Notes <!-- Optionally, replace `N/A` with text to be included in the next release notes. The `N/A` bullets are ignored. If you refer to one or more Positron issues, these issues are used to collect information about the feature or bugfix, such as the relevant language pack as determined by Github labels of type `lang: `. The note will automatically be tagged with the language. These notes are typically filled by the Positron team. If you are an external contributor, you may ignore this section. --> #### New Features - N/A #### Bug Fixes - #3740 ### QA Notes 1. Create a Python interpreter <3.8 (if you are a pyenv user, you can do pyenv install 3.6) 2. Fo to `Python: Select Interpreter`, should not appear in dropdown 3. Go to Positron interpreter selector, should not appear here either
Should block <3.8 interpreters from being registered when found. It seems to fix everything for me locally, I think this is the only place where old interpreters could sneak by. ### Release Notes <!-- Optionally, replace `N/A` with text to be included in the next release notes. The `N/A` bullets are ignored. If you refer to one or more Positron issues, these issues are used to collect information about the feature or bugfix, such as the relevant language pack as determined by Github labels of type `lang: `. The note will automatically be tagged with the language. These notes are typically filled by the Positron team. If you are an external contributor, you may ignore this section. --> #### New Features - N/A #### Bug Fixes - #3740 ### QA Notes 1. Create a Python interpreter <3.8 (if you are a pyenv user, you can do pyenv install 3.6) 2. Fo to `Python: Select Interpreter`, should not appear in dropdown 3. Go to Positron interpreter selector, should not appear here either
Verified Fixed
Test scenario(s)Did not see unsupported python in interpreter dropdown or command quick pick Link(s) to TestRail test cases run or created: |
Dear developers and maintainers, I have the highest respect for your outstanding work.
When I ran a test on python version 3.6.2 with jupyter, I was told that I needed to upgrade ipykernel to connect to the console. Positron reminds me that I need to upgrade ipykernel, but doesn't report the minimum version required, and the automatic installation that the ide tried afterwards undoubtedly failed, after all, 3.6 is indeed a bit outdated.
Nonetheless, I think the minimum version required to report that allows users to install themselves in the terminal is needed.
Thank you for your attention and have a great day!
The text was updated successfully, but these errors were encountered: