You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, Suddenly, over the past few days, I've noticed my laptop heating up too quickly. When I check the CPU, some bash processes are using a significant amount of CPU. Upon more deeper check, I found that it is due to the VSCode Pylance extension. If I disable it, the issue goes away, but as soon as I enable it, CPU usage goes up.
I even tried reinstalling VSCode and installing different versions of Pylance, including the pre-release and the latest one, but the issue persists. By the way, I also tried disabling indexing with "python.analysis.indexing": false, but the issue persists.
When I check the VS Code process explorer, I see that the command bash /opt/homebrew/Cellar/pyenv/2.4.8/libexec/pyenv-which python is running too frequently and consuming a lot of CPU. When I disable the extension, it goes away.
I have removed the json-language-feature extension. Now, the load has dropped significantly, but the ms-python.python-2024.10.0-darwin-arm64 process is still consuming resources.
Sagar Ghimire (@sagargg) thank you for filing this issue and sorry you are running into this. Karthik Nadig (@karthiknadig) any idea why pet is running in stable version of VS Code and Stable Python?
The version installed is Python- v2024.10.0
Sagar Ghimire (@sagargg) Please can you install the latest pre-release version of the Python extension
This should be fixed in the pre-release version today.
Open the extensions page, search for Python and click the button Switch to Pre-Release Version
Upon installing the pre-you might have to restart the extension host (please do so, or reload VS Code)
The latest pre-release version is 2024.11.2024****
If you still run into these issues, please can you share the logs from the Python Locator
Use the command Python: Show Output
Then from the drop down select, Python Locator and copy all of the logs
Don Jayamanne (@DonJayamanne) Yes, i'm seeing spike running second command. Does this mean it's not related to VS code but related to my local python setup?
Does this mean it's not related to VS code but related to my local python setup?
Yes, thats correct.
Does the execution not complete in the terminal?
If you aren't using this, and given that it doesn't work, you can just delete this or try to replace the exe with a symlink from one that works.
Activity
rchiodo commentedon Jul 23, 2024
Thanks for the issue. We actually have a command you can run that will tell us what the pylance extension is doing:
If you run that command it will generate a CPU profile of our different threads and we can see what we were busy doing.
I'd recommend updating to the latest version of Pylance first though.
Additionally the logs as described here should indicate what Pylance is doing as well:
https://github.com/microsoft/pylance-release/blob/main/TROUBLESHOOTING.md#filing-an-issue
sagargg commentedon Jul 24, 2024
Rich Chiodo (@rchiodo) it seems fine on the cpu profile, sharing here screeshots.
When I check the VS Code process explorer, I see that the command
bash /opt/homebrew/Cellar/pyenv/2.4.8/libexec/pyenv-which pythonis running too frequently and consuming a lot of CPU. When I disable the extension, it goes away.sagargg commentedon Jul 24, 2024
I have removed the
json-language-featureextension. Now, the load has dropped significantly, but thems-python.python-2024.10.0-darwin-arm64process is still consuming resources.sagargg commentedon Jul 24, 2024
I managed to fix it. I've reinstalled pyenv, and it's resolved now.
Thanks for the help.
sagargg commentedon Jul 25, 2024
Reopening the issue as it still persists. I can confirm this is more related to the Python extension. This is what i got in vs code process exploerer.
rchiodo commentedon Jul 25, 2024
I might be misunderstanding your process hierarchy but this looks like the python extension, not the pylance extension.
DonJayamanne commentedon Jul 25, 2024
Sagar Ghimire (@sagargg) thank you for filing this issue and sorry you are running into this.
Karthik Nadig (@karthiknadig) any idea why pet is running in stable version of VS Code and Stable Python?
The version installed is
Python- v2024.10.0Sagar Ghimire (@sagargg) Please can you install the latest pre-release version of the Python extension
This should be fixed in the pre-release version today.
Switch to Pre-Release VersionIf you still run into these issues, please can you share the logs from the
Python LocatorPython: Show OutputPython Locatorand copy all of the logskarthiknadig commentedon Jul 25, 2024
We run
petin parallel to JS discovery to see if anything is missed inpet.sagargg commentedon Jul 26, 2024
Hi Don Jayamanne (@DonJayamanne) Karthik Nadig (@karthiknadig) Thank you so much for getting back to me about the issue. I have installed the pre-release version of Python as you suggested, but the issue still persists.
This is the log i got from locator.
DonJayamanne commentedon Jul 26, 2024
Sagar Ghimire (@sagargg) Please can you enable
tracelogging as followsDeveloper: Set Log LevelTracePython Locator, please send all of the logs.thanks
sagargg commentedon Jul 26, 2024
Don Jayamanne (@DonJayamanne) This is what i got, is that helpful?
DonJayamanne commentedon Jul 26, 2024
Sagar Ghimire (@sagargg) Based on the logs, you shouldn't see a high CPU anymore.
Or is that not the case, if it is, then
Thanks
sagargg commentedon Jul 26, 2024
Don Jayamanne (@DonJayamanne) no, the Issue still exists,
DonJayamanne commentedon Jul 26, 2024
Thanks for sharing the logs again, and your patience.
Please can you try running the following command in your terminal:
readlink -f /usr/local/bin/python/usr/local/bin/python -c "import json, sys; print('093385e9-59f7-4a16-a604-14bf206256fe');print(json.dumps({'version': '.'.join(str(n) for n in sys.version_info), 'sys_prefix': sys.prefix, 'executable': sys.executable, 'is64_bit': sys.maxsize > 2**32}))"sagargg commentedon Jul 28, 2024
Don Jayamanne (@DonJayamanne) Yes, i'm seeing spike running second command. Does this mean it's not related to VS code but related to my local python setup?

DonJayamanne commentedon Jul 30, 2024
Yes, thats correct.
Does the execution not complete in the terminal?
If you aren't using this, and given that it doesn't work, you can just delete this or try to replace the exe with a symlink from one that works.
Closing as this isn't caused by the finder.