-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Extension v2024.4.0 and v2024.4.1 create indefinite "Discover Python Interpreters" #23452
Comments
Hi @dokutoshi. Thank you for filing the issue. Can you set your log level to trace in command palette and share your Python output info accessible in output for Python? |
Interesting..Does |
Also wondering if problem persists in version below v2024.4.0 |
I will look into this later today.
Prescriptive measure include setting log level == 'trace' and cmd+shift+p
On May 22, 2024, at 14:49, Anthony Kim ***@***.***> wrote:
Also wondering if problem persists in version below v2024.4.0
—
Reply to this email directly, view it on GitHub<#23452 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACNWBJOTDMYMQLMVSSOMG6TZDTSCVAVCNFSM6AAAAABH63ATVOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRVGUZDMNRRGI>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
This email and any attachments may contain private, confidential and privileged material for the sole use of the intended recipient. Any review, reliance or distribution by others or forwarding without express permission is strictly prohibited. If you are not the intended recipient, please notify the sender immediately and delete this email and any attachments afterwards.
|
Clearing the cache and reloading the window does solve the infinite running issue. However, the reason i opened this ticket relates to this bug: 48 hours into testing, |
@dokutoshi Can you bring the requested logs and also check if same problem exists in version below 2024.4.0 that you have mentioned? |
Dealing with a related issue in Vscode Insiders that crashes Pylance and triggers Discovering Python Interpreters. For reference, here is the Python log output. 2024-06-04 18:31:35.095 [info] shell: bash 2024-06-04 18:31:35.816 [warning] [Error: Command failed: /usr/bin/python -I /home/ec2-user/.vscode-server-insiders/extensions/ms-python.python-2024.6.0/python_files/get_output_via_markers.py /home/ec2-user/.vscode-server-insiders/extensions/ms-python.python-2024.6.0/python_files/interpreterInfo.py
code: 2, |
For clarification, the Both local (Mac) and remote SSH (from Mac to Linux) exhibit the issues. Version: 1.84.2 Ahh, ran extension profiler. |
@dokutoshi Thanks for the requested logs.
from your log. Support for 2.7 has been dropped by Python extension. Reference: https://github.com/microsoft/vscode-python/wiki/Limited-support-for-Python-2.7 |
No, I use python 3.10 - 3.12. Conda environments established on the ec2. Why is vscode searching the ec2 for possible python directories outside of the designated environment? Best, Leo |
Btw, is there a method to suppress the discovery process e..g "Discovering Python Interpreters". The process appears event or timer based. is there a method to make this process interactive i.e. user controlled? |
It is not necessarily VS Code, it would be Python extension or other extension IN VS Code that is triggering interpreter discovery.
I don't think so. The problem you are having can happen when some other extension triggers discovery, or there is some changes in the Python environment that you have set up. For now you can pin the extension to older version where everything used to work for you until we investigate this further. I will keep this issue open just so I can get a census/reports of to the extent other users are experiencing the issue. |
Maybe the Python Debugger extension @anthonykim1 |
Figured out the bug: Here is the latest @anthonykim1 ... it appears VScode's Python extension joins the local python environments and remote python environment directories, perhaps into a list of paths. Remote device: Python Log Remote device: /usr/bin/python3 Local device: python2 not found /opt/homebrew/bin/python3 Setup:
Temporary Solution: Create the symbolic linksudo ln -s /usr/bin/python3 /opt/homebrew/bin/python3 Verify the symlinkls -l /opt/homebrew/bin/python3` Result of Python discovery: Post-fix: |
Is there an approach to limit the Python environment to a specific path e.g. in a workspace environment file?
|
Really appreciate some help here @anthonykim1
Issues were not solved. I suggest a look at the possible solution.
|
Turned on Trace log
Hypothesis: Some disconnect occurs during Remote SSH or Tunnels. I guess the reconnection triggers the Python Discovery process @anthonykim1 AWS support recommended this ticket is related: microsoft/vscode-remote-release#9832 These errors occur for both Remote SSH or Remote Tunnels. Errors
|
Please take a look at this @karthiknadig . I believe it relates to concerns in this ticket. #21639
|
May hint at the a test scenario @karthiknadig Solution proposed on Mar 31, 2024 Eventually the remote SSH is dropped because the Discovery Crashes the IDE. Then the process starts over again. Extremely frustrating.
|
Solved! Followed the answer to Number 1. I moved the notebook and other code source files to another project. The image directory with millions of files is outside of the project folder. Why is the discovery process scanning all the subdirectories???? @karthiknadig @DonJayamanne @anthonykim1 |
It looks for virtual environments created for monorepos this way. As I said we are re-doing this to be more efficient. But, basically some projects have several virtual environments for each sub folder, that we need to support. We are changing this to handle cases like yours better. |
@karthiknadig it is far simpler. I was able to recreate the issue locally.
I was able to recreate this on a few machines - local and remote are both faster when using only the src folder and not including the data folder (1,000,000+ images, files, etc) Best, Leo |
One final question - @karthiknadig @anthonykim1. Why not allow the "folders to exclude" feature to limit the search path for the python interpreters or better yet, allow the user to customize? It is not advised for the sentinel to search across a device; there are corporate concerns with such activity that will prevent the use of the tool. |
We do have plans on adding customizable excludes in the new work that is being done for environment discovery. But the old discovery will likely not get update to add the new features to it. |
Is the current solution to limit the number of files inside a workspace e.g. remove large data i.e. image or corpus directories? |
Unfortunately yes. |
@karthiknadig - Does Visual Studio have the same limitations i.e. python interpreter scans all files in workspace? ahh, not a long term solution anyhow... https://learn.microsoft.com/en-us/visualstudio/mac/what-happened-to-vs-for-mac?view=vsmac-2022 |
@dokutoshi For long term we are going to switch to a different mechanism for discovery and one of the things we are seeing there is providing a way to exclude certain directories, in addition to improving the search performance. |
@karthiknadig that would be most excellent. From a corporate perspective, the current limitation created the following situation:
These are significant changes at a corporate level . Ubuntu brings its own inherent limitations non-XFS etc that required further steps to support ML workflows. |
the bot closed the open ticket after 3 days - that is too short a window - please adjust the bot. Python Uncaught Error 2024.2.1](#23554 (comment)) Clearing the cache with each reload is standard practice. One important test scenario: I extended the workspace using "Add Folder to Workspace" to include a functional folder for TensorFlow. For clarification: The first folder contains Python source files and a notebook (a static folder). The second folder (the TensorFlow folder) contains logs and metadata files generated by TensorFlow during training, typically per epoch, to save model weights and biases (a dynamic folder). PyTorch has a similar on-training file creation. Post-observations after including a dynamic folder show that the growth in file count (less than 10 files) during an active kernel leads to a kernel halt. This is different, in my opinion, from including a large data directory with millions of images. In the dynamic folder case, behavior suggests that files added/created in an active workspace trigger the Python discovery process, interrupting an active kernel. Best, Leo |
Type: Bug
Behaviour
Expected vs. Actual
Install v2024.4.0 or v2024.4.1 extension and the discovering Python interpreters run indefinitely. This also restarts the kernel periodically - a MAJOR PROBLEM when excecuting ML notebooks - lost variables imply retraining or reloading a pandas DF etc.
XXX
Steps to reproduce:
To stop the kernel from periodic restarts use v2024.2.1
Diagnostic data
python.languageServer
setting: PylanceOutput for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)User Settings
Extension version: 2024.2.1
VS Code version: Code 1.88.0 (5c3e652f63e798a5ac2f31ffd0d863669328dc4c, 2024-04-03T13:28:09.495Z)
OS version: Darwin arm64 23.5.0
Modes:
System Info
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
A/B Experiments
The text was updated successfully, but these errors were encountered: