Skip to content

High CPU usages #134

Closed
Closed

Description

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.

Screenshot 2024-07-23 at 1 28 15 PM

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.

Vscode version

Version: 1.91.1 (Universal)
Commit: f1e16e1e6214d7c44d078b1f0607b2388f29d729
Date: 2024-07-09T22:07:54.982Z
Electron: 29.4.0
ElectronBuildId: 9728852
Chromium: 122.0.6261.156
Node.js: 20.9.0
V8: 12.2.281.27-electron.0
OS: Darwin arm64 23.5.0

Extension versions


Pylance -v2024.4.1
Python- v2024.10.0

I would greatly appreciate any help. thanks

Activity

  1. rchiodo commented on Jul 23, 2024

    @rchiodo

    Thanks for the issue. We actually have a command you can run that will tell us what the pylance extension is doing:

    image

    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

  2. sagargg commented on Jul 24, 2024

    @sagargg
    Author

    Rich Chiodo (@rchiodo) it seems fine on the cpu profile, sharing here screeshots.

    Screenshot 2024-07-24 at 8 54 12 AM Screenshot 2024-07-24 at 8 54 21 AM

    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.

    Screenshot 2024-07-24 at 8 55 14 AM
  3. sagargg commented on Jul 24, 2024

    @sagargg
    Author

    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.

    Screenshot 2024-07-24 at 11 56 57 AM
  4. sagargg commented on Jul 24, 2024

    @sagargg
    Author

    I managed to fix it. I've reinstalled pyenv, and it's resolved now.
    Thanks for the help.

  5. sagargg commented on Jul 25, 2024

    @sagargg
    Author

    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.

    Screenshot 2024-07-25 at 9 10 03 AM
  6. rchiodo commented on Jul 25, 2024

    @rchiodo

    I might be misunderstanding your process hierarchy but this looks like the python extension, not the pylance extension.

  7. DonJayamanne commented on Jul 25, 2024

    @DonJayamanne
    Collaborator

    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****

    Image

    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

    Image

  8. karthiknadig commented on Jul 25, 2024

    @karthiknadig
    Member

    We run pet in parallel to JS discovery to see if anything is missed in pet.

  9. sagargg commented on Jul 26, 2024

    @sagargg
    Author

    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.

    Screenshot 2024-07-26 at 7 19 37 AM

    This is the log i got from locator.

    2024-07-26 07:08:05.702 [info] Starting Python Locator /Users/sagarg/.vscode/extensions/ms-python.python-2024.11.2024072502-darwin-arm64/python-env-tools/bin/pet server
    2024-07-26 07:08:05.756 [info] Discovered manager: (Pyenv) /opt/homebrew/bin/pyenv
    2024-07-26 07:08:05.781 [info] Discovered env: /usr/local/bin/python3
    2024-07-26 07:08:05.782 [info] Discovered env: /usr/bin/python3
    2024-07-26 07:08:05.785 [info] Discovered env: /Users/sagarg/.pyenv/versions/sigma2/bin/python
    2024-07-26 07:08:05.785 [info] Discovered env: /Users/sagarg/.pyenv/versions/3.10.12/bin/python
    2024-07-26 07:08:05.787 [info] Discovered env: /opt/homebrew/bin/python3
    2024-07-26 07:08:05.789 [info] Discovered env: /opt/homebrew/bin/python3.11
    2024-07-26 07:08:05.821 [info] Resolved /opt/homebrew/bin/python3
    2024-07-26 07:08:05.822 [info] Resolved /opt/homebrew/bin/python3.11
  10. DonJayamanne commented on Jul 26, 2024

    @DonJayamanne
    Collaborator

    Sagar Ghimire (@sagargg) Please can you enable trace logging as follows

    • From command palette select Developer: Set Log Level
    • Select Trace
    • Reload VS Code
    • Try to replicate the issue again and send the logs from the Python Locator, please send all of the logs.
      thanks
  11. sagargg commented on Jul 26, 2024

    @sagargg
    Author

    Don Jayamanne (@DonJayamanne) This is what i got, is that helpful?

    2024-07-26 08:21:20.834 [info] Starting Python Locator /Users/me/.vscode/extensions/ms-python.python-2024.11.2024072502-darwin-arm64/python-env-tools/bin/pet server
    2024-07-26 08:21:20.834 [debug] Env PATH: ["/Users/me/.yarn/bin", "/Users/me/.config/yarn/global/node_modules/.bin", "/Users/me/go/bin", "/Users/me/Documents/google-cloud-sdk/bin", "/Users/me/.nvm/versions/node/v16.13.0/bin", "/opt/homebrew/Cellar/pyenv-virtualenv/1.2.4/shims", "/Users/me/.pyenv/shims", "/Users/me/.pyenv/bin", "/opt/homebrew/bin", "/opt/homebrew/sbin", "/usr/local/bin", "/System/Cryptexes/App/usr/bin", "/usr/bin", "/bin", "/usr/sbin", "/sbin", "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin", "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin", "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin", "/opt/X11/bin", "/usr/local/go/bin"]
    2024-07-26 08:21:21.005 [debug] Setting cache directory to "/Users/me/Library/Application Support/Code/User/globalStorage/ms-python.python/pythonLocator"
    2024-07-26 08:21:21.012 [debug] Configuring locators: Configuration { workspace_directories: Some(["/Users/me/Documents/datopain/project/ckanext/ckanext-project"]), executables: None, conda_executable: None, poetry_executable: Some("poetry"), environment_directories: Some([]), cache_directory: Some("/Users/me/Library/Application Support/Code/User/globalStorage/ms-python.python/pythonLocator") }
    2024-07-26 08:21:21.016 [debug] Start refreshing environments, config: Configuration { workspace_directories: Some(["/Users/me/Documents/datopain/project/ckanext/ckanext-project"]), executables: None, conda_executable: None, poetry_executable: Some("poetry"), environment_directories: Some([]), cache_directory: Some("/Users/me/Library/Application Support/Code/User/globalStorage/ms-python.python/pythonLocator") }
    2024-07-26 08:21:21.016 [debug] Searching using locator: Venv
    2024-07-26 08:21:21.016 [debug] Completed searching using locator: Venv in 21.792µs
    2024-07-26 08:21:21.016 [debug] Searching using locator: MacXCode
    2024-07-26 08:21:21.016 [debug] Completed searching using locator: MacXCode in 5.667µs
    2024-07-26 08:21:21.016 [debug] Searching for environments in global venv folders: []
    2024-07-26 08:21:21.016 [debug] Searching using locator: PyEnv
    2024-07-26 08:21:21.017 [debug] PyEnv Info PyEnvInfo { exe: Some("/opt/homebrew/bin/pyenv"), versions: Some("/Users/me/.pyenv/versions"), version: Some("2.4.8") }
    2024-07-26 08:21:21.017 [debug] Reporting Manager EnvManager { executable: "/opt/homebrew/bin/pyenv", version: Some("2.4.8"), tool: Pyenv }
    2024-07-26 08:21:21.023 [info] Discovered manager: (Pyenv) /opt/homebrew/bin/pyenv
    2024-07-26 08:21:21.089 [debug] Searching using locator: Homebrew
    2024-07-26 08:21:21.096 [debug] Searching using locator: Conda
    2024-07-26 08:21:21.100 [debug] Searching using locator: Poetry
    2024-07-26 08:21:21.101 [debug] Searching using locator: PipEnv
    2024-07-26 08:21:21.105 [debug] Completed searching using locator: PipEnv in 2.292µs
    2024-07-26 08:21:21.107 [debug] Searching using locator: VirtualEnvWrapper
    2024-07-26 08:21:21.110 [debug] Completed searching using locator: VirtualEnvWrapper in 5.292µs
    2024-07-26 08:21:21.112 [debug] Searching using locator: VirtualEnv
    2024-07-26 08:21:21.112 [debug] Completed searching using locator: VirtualEnv in 9.208µs
    2024-07-26 08:21:21.112 [debug] Reporting Environment PythonEnvironment { display_name: None, name: None, executable: Some("/Users/me/.pyenv/versions/3.10.12/bin/python"), kind: Some(Pyenv), version: Some("3.10.12"), prefix: Some("/Users/me/.pyenv/versions/3.10.12"), manager: Some(EnvManager { executable: "/opt/homebrew/bin/pyenv", version: Some("2.4.8"), tool: Pyenv }), project: None, arch: None, symlinks: Some(["/Users/me/.pyenv/versions/3.10.12/bin/python", "/Users/me/.pyenv/versions/3.10.12/bin/python3", "/Users/me/.pyenv/versions/3.10.12/bin/python3.10"]) }
    2024-07-26 08:21:21.112 [info] Discovered env: /Users/me/.pyenv/versions/3.10.12/bin/python
    2024-07-26 08:21:21.113 [debug] Searching using locator: MacCommandLineTools
    2024-07-26 08:21:21.113 [debug] Searching using locator: MacPythonOrg
    2024-07-26 08:21:21.114 [debug] Using cache from "/Users/me/Library/Application Support/Code/User/globalStorage/ms-python.python/pythonLocator/31f2aee4e71d21fb.3.json" for "/usr/bin/python3"
    2024-07-26 08:21:21.114 [debug] Reporting Environment PythonEnvironment { display_name: None, name: None, executable: Some("/usr/local/bin/python3"), kind: Some(MacPythonOrg), version: Some("3.10.11"), prefix: Some("/Library/Frameworks/Python.framework/Versions/3.10"), manager: None, project: None, arch: None, symlinks: Some(["/Library/Frameworks/Python.framework/Versions/3.10/bin/python3", "/Library/Frameworks/Python.framework/Versions/3.10/bin/python3.10", "/Library/Frameworks/Python.framework/Versions/Current/bin/python3", "/Library/Frameworks/Python.framework/Versions/Current/bin/python3.10", "/usr/local/bin/python3", "/usr/local/bin/python3.10"]) }
    2024-07-26 08:21:21.114 [info] Discovered env: /usr/local/bin/python3
    2024-07-26 08:21:21.116 [debug] Completed searching using locator: MacPythonOrg in 108.080125ms
    2024-07-26 08:21:21.116 [debug] Searching for environments in workspace folders: ["/Users/me/Documents/datopain/project/ckanext/ckanext-project"]
    2024-07-26 08:21:21.116 [debug] Reporting Environment PythonEnvironment { display_name: None, name: None, executable: Some("/Users/me/.pyenv/versions/project/bin/python"), kind: Some(PyenvVirtualEnv), version: Some("3.10.12"), prefix: Some("/Users/me/.pyenv/versions/project"), manager: Some(EnvManager { executable: "/opt/homebrew/bin/pyenv", version: Some("2.4.8"), tool: Pyenv }), project: None, arch: None, symlinks: Some(["/Users/me/.pyenv/versions/project/bin/python", "/Users/me/.pyenv/versions/project/bin/python3", "/Users/me/.pyenv/versions/project/bin/python3.10"]) }
    2024-07-26 08:21:21.118 [debug] Getting homebrew python info for "/opt/homebrew/bin/python3.12" => "/opt/homebrew/Cellar/python@3.12/3.12.4/Frameworks/Python.framework/Versions/3.12/bin/python3.12" with version Some("3.12.4")
    2024-07-26 08:21:21.118 [debug] Getting homebrew python info for "/opt/homebrew/bin/python3.11" => "/opt/homebrew/Cellar/python@3.11/3.11.9_1/Frameworks/Python.framework/Versions/3.11/bin/python3.11" with version Some("3.11.9")
    2024-07-26 08:21:21.119 [info] Discovered env: /Users/me/.pyenv/versions/project/bin/python
    2024-07-26 08:21:21.119 [debug] Poetry exe not found
    2024-07-26 08:21:21.119 [debug] Poetry Manager None
    2024-07-26 08:21:21.122 [debug] Completed searching using locator: Poetry in 111.228459ms
    2024-07-26 08:21:21.122 [debug] Searching for environments in global folders: ["/Users/me/.yarn/bin", "/Users/me/go/bin", "/Users/me/Documents/google-cloud-sdk/bin", "/Users/me/.nvm/versions/node/v16.13.0/bin", "/opt/homebrew/Cellar/pyenv-virtualenv/1.2.4/shims", "/Users/me/.pyenv/shims", "/opt/homebrew/bin", "/opt/homebrew/sbin", "/usr/local/bin", "/System/Cryptexes/App/usr/bin", "/usr/bin", "/bin", "/usr/sbin", "/sbin", "/opt/X11/bin", "/usr/local/go/bin", "/etc", "/usr/lib", "/usr/libexec", "/usr/local", "/usr/local/lib", "/usr/share", "/opt"]
    2024-07-26 08:21:21.122 [debug] No Conda environments in .condarc
    2024-07-26 08:21:21.122 [debug] Conda environments in known paths ["/System/Cryptexes/App/usr/bin", "/Users/me/.nvm/versions/node/v16.13.0/bin", "/Users/me/.pyenv/shims", "/Users/me/.yarn/bin", "/Users/me/Documents/google-cloud-sdk/bin", "/Users/me/go/bin", "/bin", "/etc", "/opt", "/opt/X11/bin", "/opt/homebrew/Cellar/pyenv-virtualenv/1.2.4/shims", "/opt/homebrew/bin", "/opt/homebrew/sbin", "/sbin", "/usr/bin", "/usr/lib", "/usr/libexec", "/usr/local", "/usr/local/bin", "/usr/local/go/bin", "/usr/local/lib", "/usr/sbin", "/usr/share"]
    2024-07-26 08:21:21.123 [debug] Reporting Environment PythonEnvironment { display_name: None, name: None, executable: Some("/usr/bin/python3"), kind: Some(MacCommandLineTools), version: Some("3.9.6.final.0"), prefix: Some("/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9"), manager: None, project: None, arch: Some(X64), symlinks: Some(["/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/bin/python3", "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/bin/python3.9", "/Library/Developer/CommandLineTools/usr/bin/python3", "/Library/Developer/CommandLineTools/usr/bin/python3.9", "/usr/bin/python3"]) }
    2024-07-26 08:21:21.123 [info] Discovered env: /usr/bin/python3
    2024-07-26 08:21:21.123 [debug] Completed searching using locator: MacCommandLineTools in 112.662791ms
    2024-07-26 08:21:21.123 [debug] Completed searching using locator: PyEnv in 114.875333ms
    2024-07-26 08:21:21.123 [debug] Executing 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}))
    2024-07-26 08:21:21.125 [debug] Ignoring folder: "/Users/me/Documents/datopain/project/ckanext/ckanext-project/.github"
    2024-07-26 08:21:21.126 [debug] Ignoring folder: "/Users/me/Documents/datopain/project/ckanext/ckanext-project/.git"
    2024-07-26 08:21:21.126 [debug] Ignoring folder: "/Users/me/Documents/datopain/project/ckanext/ckanext-project/.vscode"
    2024-07-26 08:21:21.128 [debug] Getting homebrew python info for "/opt/homebrew/bin/python3" => "/opt/homebrew/Cellar/python@3.12/3.12.4/Frameworks/Python.framework/Versions/3.12/bin/python3.12" with version Some("3.12.4")
    2024-07-26 08:21:21.128 [debug] Time taken to get conda environment paths: 204.429ms
    2024-07-26 08:21:21.128 [debug] Completed searching using locator: Conda in 205.14975ms
    2024-07-26 08:21:21.128 [debug] Reporting Environment PythonEnvironment { display_name: None, name: None, executable: Some("/opt/homebrew/bin/python3"), kind: Some(Homebrew), version: Some("3.12.4"), prefix: None, manager: None, project: None, arch: None, symlinks: Some(["/opt/homebrew/Cellar/python@3.12/3.12.4/Frameworks/Python.framework/Versions/3.12/bin/python3", "/opt/homebrew/Cellar/python@3.12/3.12.4/Frameworks/Python.framework/Versions/3.12/bin/python3.12", "/opt/homebrew/Cellar/python@3.12/3.12.4/Frameworks/Python.framework/Versions/Current/bin/python3", "/opt/homebrew/Cellar/python@3.12/3.12.4/Frameworks/Python.framework/Versions/Current/bin/python3.12", "/opt/homebrew/Cellar/python@3.12/3.12.4/bin/python3", "/opt/homebrew/Cellar/python@3.12/3.12.4/bin/python3.12", "/opt/homebrew/Frameworks/Python.framework/Versions/3.12/bin/python3", "/opt/homebrew/Frameworks/Python.framework/Versions/3.12/bin/python3.12", "/opt/homebrew/Frameworks/Python.framework/Versions/Current/bin/python3", "/opt/homebrew/Frameworks/Python.framework/Versions/Current/bin/python3.12", "/opt/homebrew/bin/python3", "/opt/homebrew/bin/python3.12", "/opt/homebrew/opt/python/bin/python3", "/opt/homebrew/opt/python/bin/python3.12", "/opt/homebrew/opt/python3/bin/python3", "/opt/homebrew/opt/python3/bin/python3.12", "/opt/homebrew/opt/python@3/bin/python3", "/opt/homebrew/opt/python@3/bin/python3.12", "/opt/homebrew/opt/python@3.12/bin/python3", "/opt/homebrew/opt/python@3.12/bin/python3.12"]) }
    2024-07-26 08:21:21.128 [info] Discovered env: /opt/homebrew/bin/python3
    2024-07-26 08:21:21.128 [debug] Reporting Environment PythonEnvironment { display_name: None, name: None, executable: Some("/opt/homebrew/bin/python3.11"), kind: Some(Homebrew), version: Some("3.11.9"), prefix: None, manager: None, project: None, arch: None, symlinks: Some(["/opt/homebrew/Cellar/python@3.11/3.11.9_1/Frameworks/Python.framework/Versions/3.11/bin/python3.11", "/opt/homebrew/Frameworks/Python.framework/Versions/3.11/bin/python3.11", "/opt/homebrew/bin/python3.11", "/opt/homebrew/opt/python@3.11/bin/python3.11"]) }
    2024-07-26 08:21:21.128 [info] Discovered env: /opt/homebrew/bin/python3.11
    2024-07-26 08:21:21.129 [debug] Completed searching using locator: Homebrew in 221.870375ms
    2024-07-26 08:21:21.130 [debug] Getting homebrew python info for "/opt/homebrew/bin/python3.11" => "/opt/homebrew/Cellar/python@3.11/3.11.9_1/Frameworks/Python.framework/Versions/3.11/bin/python3.11" with version Some("3.11.9")
    2024-07-26 08:21:21.130 [debug] Getting homebrew python info for "/opt/homebrew/bin/python3.12" => "/opt/homebrew/Cellar/python@3.12/3.12.4/Frameworks/Python.framework/Versions/3.12/bin/python3.12" with version Some("3.12.4")
    2024-07-26 08:21:21.131 [debug] Env ("/usr/bin/python3") in Path resolved as Some(MacCommandLineTools)
    2024-07-26 08:21:21.133 [debug] Resolving env "/opt/homebrew/bin/python3"
    2024-07-26 08:21:21.133 [debug] Getting homebrew python info for "/opt/homebrew/bin/python3" => "/opt/homebrew/Cellar/python@3.12/3.12.4/Frameworks/Python.framework/Versions/3.12/bin/python3.12" with version Some("3.12.4")
    2024-07-26 08:21:21.135 [debug] Resolving env "/opt/homebrew/bin/python3.11"
    2024-07-26 08:21:21.137 [debug] Getting homebrew python info for "/opt/homebrew/bin/python3.11" => "/opt/homebrew/Cellar/python@3.11/3.11.9_1/Frameworks/Python.framework/Versions/3.11/bin/python3.11" with version Some("3.11.9")
    2024-07-26 08:21:21.146 [debug] Using cache from "/Users/me/Library/Application Support/Code/User/globalStorage/ms-python.python/pythonLocator/5c7b89af1651d0b8.3.json" for "/opt/homebrew/bin/python3.11"
    2024-07-26 08:21:21.147 [debug] In resolve_environment, Resolved Python Exe "/opt/homebrew/bin/python3.11" as ResolvedPythonEnv { executable: "/opt/homebrew/opt/python@3.11/bin/python3.11", prefix: "/opt/homebrew/opt/python@3.11/Frameworks/Python.framework/Versions/3.11", version: "3.11.9.final.0", is64_bit: true, symlinks: Some(["/opt/homebrew/bin/python3.11", "/opt/homebrew/opt/python@3.11/bin/python3.11"]) }
    2024-07-26 08:21:21.148 [debug] Resolved env (Ok(14.365ms)) "/opt/homebrew/bin/python3.11" as PythonEnvironment { display_name: None, name: None, executable: Some("/opt/homebrew/bin/python3.11"), kind: Some(Homebrew), version: Some("3.11.9.final.0"), prefix: Some("/opt/homebrew/opt/python@3.11/Frameworks/Python.framework/Versions/3.11"), manager: None, project: None, arch: Some(X64), symlinks: Some(["/opt/homebrew/Cellar/python@3.11/3.11.9_1/Frameworks/Python.framework/Versions/3.11/bin/python3.11", "/opt/homebrew/Frameworks/Python.framework/Versions/3.11/bin/python3.11", "/opt/homebrew/bin/python3.11", "/opt/homebrew/opt/python@3.11/bin/python3.11"]) }
    2024-07-26 08:21:21.152 [info] Resolved /opt/homebrew/bin/python3.11
    2024-07-26 08:21:21.154 [debug] Using cache from "/Users/me/Library/Application Support/Code/User/globalStorage/ms-python.python/pythonLocator/b0fa6594d8f4cbf1.3.json" for "/opt/homebrew/bin/python3"
    2024-07-26 08:21:21.155 [debug] In resolve_environment, Resolved Python Exe "/opt/homebrew/bin/python3" as ResolvedPythonEnv { executable: "/opt/homebrew/opt/python@3.12/bin/python3.12", prefix: "/opt/homebrew/opt/python@3.12/Frameworks/Python.framework/Versions/3.12", version: "3.12.4.final.0", is64_bit: true, symlinks: Some(["/opt/homebrew/bin/python3", "/opt/homebrew/opt/python@3.12/bin/python3.12"]) }
    2024-07-26 08:21:21.155 [debug] Resolved env (Ok(19.69ms)) "/opt/homebrew/bin/python3" as PythonEnvironment { display_name: None, name: None, executable: Some("/opt/homebrew/bin/python3"), kind: Some(Homebrew), version: Some("3.12.4.final.0"), prefix: Some("/opt/homebrew/opt/python@3.12/Frameworks/Python.framework/Versions/3.12"), manager: None, project: None, arch: Some(X64), symlinks: Some(["/opt/homebrew/Cellar/python@3.12/3.12.4/Frameworks/Python.framework/Versions/3.12/bin/python3", "/opt/homebrew/Cellar/python@3.12/3.12.4/Frameworks/Python.framework/Versions/3.12/bin/python3.12", "/opt/homebrew/Cellar/python@3.12/3.12.4/Frameworks/Python.framework/Versions/Current/bin/python3", "/opt/homebrew/Cellar/python@3.12/3.12.4/Frameworks/Python.framework/Versions/Current/bin/python3.12", "/opt/homebrew/Cellar/python@3.12/3.12.4/bin/python3", "/opt/homebrew/Cellar/python@3.12/3.12.4/bin/python3.12", "/opt/homebrew/Frameworks/Python.framework/Versions/3.12/bin/python3", "/opt/homebrew/Frameworks/Python.framework/Versions/3.12/bin/python3.12", "/opt/homebrew/Frameworks/Python.framework/Versions/Current/bin/python3", "/opt/homebrew/Frameworks/Python.framework/Versions/Current/bin/python3.12", "/opt/homebrew/bin/python3", "/opt/homebrew/bin/python3.12", "/opt/homebrew/opt/python/bin/python3", "/opt/homebrew/opt/python/bin/python3.12", "/opt/homebrew/opt/python3/bin/python3", "/opt/homebrew/opt/python3/bin/python3.12", "/opt/homebrew/opt/python@3/bin/python3", "/opt/homebrew/opt/python@3/bin/python3.12", "/opt/homebrew/opt/python@3.12/bin/python3", "/opt/homebrew/opt/python@3.12/bin/python3.12"]) }
    2024-07-26 08:21:21.155 [info] Resolved /opt/homebrew/bin/python3
  12. DonJayamanne commented on Jul 26, 2024

    @DonJayamanne
    Collaborator

    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

    • Please can you share a screenshot of the code explorer
    • Can you also reload VS Code and share the logs again

    Thanks

  13. sagargg commented on Jul 26, 2024

    @sagargg
    Author

    Don Jayamanne (@DonJayamanne) no, the Issue still exists,

    Screenshot 2024-07-26 at 3 09 57 PM
    2024-07-26 15:08:11.177 [info] Starting Python Locator /Users/sagarg/.vscode/extensions/ms-python.python-2024.11.2024072502-darwin-arm64/python-env-tools/bin/pet server
    2024-07-26 15:08:11.177 [debug] Env PATH: ["/Users/sagarg/.yarn/bin", "/Users/sagarg/.config/yarn/global/node_modules/.bin", "/Users/sagarg/go/bin", "/Users/sagarg/Documents/google-cloud-sdk/bin", "/Users/sagarg/.nvm/versions/node/v16.13.0/bin", "/opt/homebrew/Cellar/pyenv-virtualenv/1.2.4/shims", "/Users/sagarg/.pyenv/shims", "/Users/sagarg/.pyenv/bin", "/opt/homebrew/bin", "/opt/homebrew/sbin", "/usr/local/bin", "/System/Cryptexes/App/usr/bin", "/usr/bin", "/bin", "/usr/sbin", "/sbin", "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin", "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin", "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin", "/opt/X11/bin", "/usr/local/go/bin"]
    2024-07-26 15:08:11.189 [debug] Start refreshing environments, config: Configuration { workspace_directories: None, executables: None, conda_executable: None, poetry_executable: None, environment_directories: None, cache_directory: None }
    2024-07-26 15:08:11.190 [debug] Setting cache directory to "/Users/sagarg/Library/Application Support/Code/User/globalStorage/ms-python.python/pythonLocator"
    2024-07-26 15:08:11.193 [debug] Configuring locators: Configuration { workspace_directories: Some(["/Users/sagarg/Documents/datopain/sigma2/ckan"]), executables: None, conda_executable: None, poetry_executable: Some("poetry"), environment_directories: Some([]), cache_directory: Some("/Users/sagarg/Library/Application Support/Code/User/globalStorage/ms-python.python/pythonLocator") }
    2024-07-26 15:08:11.195 [debug] Searching using locator: Conda
    2024-07-26 15:08:11.196 [debug] Searching using locator: Poetry
    2024-07-26 15:08:11.197 [debug] Searching using locator: MacPythonOrg
    2024-07-26 15:08:11.198 [debug] Poetry exe not found
    2024-07-26 15:08:11.199 [debug] Poetry Manager None
    2024-07-26 15:08:11.200 [debug] No Conda environments in .condarc
    2024-07-26 15:08:11.200 [debug] Searching using locator: Homebrew
    2024-07-26 15:08:11.201 [debug] Completed searching using locator: Poetry in 280.292µs
    2024-07-26 15:08:11.201 [debug] Searching using locator: VirtualEnv
    2024-07-26 15:08:11.201 [debug] Completed searching using locator: VirtualEnv in 6.167µs
    2024-07-26 15:08:11.201 [debug] Searching for environments in global folders: ["/Users/sagarg/.yarn/bin", "/Users/sagarg/go/bin", "/Users/sagarg/Documents/google-cloud-sdk/bin", "/Users/sagarg/.nvm/versions/node/v16.13.0/bin", "/opt/homebrew/Cellar/pyenv-virtualenv/1.2.4/shims", "/Users/sagarg/.pyenv/shims", "/opt/homebrew/bin", "/opt/homebrew/sbin", "/usr/local/bin", "/System/Cryptexes/App/usr/bin", "/usr/bin", "/bin", "/usr/sbin", "/sbin", "/opt/X11/bin", "/usr/local/go/bin", "/etc", "/usr/lib", "/usr/libexec", "/usr/local", "/usr/local/lib", "/usr/share", "/opt"]
    2024-07-26 15:08:11.202 [debug] Searching for environments in global venv folders: []
    2024-07-26 15:08:11.202 [debug] Searching using locator: PipEnv
    2024-07-26 15:08:11.202 [debug] Completed searching using locator: PipEnv in 4.041µs
    2024-07-26 15:08:11.202 [debug] Searching using locator: MacXCode
    2024-07-26 15:08:11.202 [debug] Completed searching using locator: MacXCode in 9.708µs
    2024-07-26 15:08:11.202 [debug] Searching using locator: VirtualEnvWrapper
    2024-07-26 15:08:11.202 [debug] Completed searching using locator: VirtualEnvWrapper in 2.458µs
    2024-07-26 15:08:11.202 [debug] Searching using locator: MacCommandLineTools
    2024-07-26 15:08:11.202 [debug] Conda environments in known paths ["/System/Cryptexes/App/usr/bin", "/Users/sagarg/.nvm/versions/node/v16.13.0/bin", "/Users/sagarg/.pyenv/shims", "/Users/sagarg/.yarn/bin", "/Users/sagarg/Documents/google-cloud-sdk/bin", "/Users/sagarg/go/bin", "/bin", "/etc", "/opt", "/opt/X11/bin", "/opt/homebrew/Cellar/pyenv-virtualenv/1.2.4/shims", "/opt/homebrew/bin", "/opt/homebrew/sbin", "/sbin", "/usr/bin", "/usr/lib", "/usr/libexec", "/usr/local", "/usr/local/bin", "/usr/local/go/bin", "/usr/local/lib", "/usr/sbin", "/usr/share"]
    2024-07-26 15:08:11.202 [debug] Searching using locator: PyEnv
    2024-07-26 15:08:11.202 [debug] PyEnv Info PyEnvInfo { exe: Some("/opt/homebrew/bin/pyenv"), versions: Some("/Users/sagarg/.pyenv/versions"), version: Some("2.4.8") }
    2024-07-26 15:08:11.202 [debug] Reporting Manager EnvManager { executable: "/opt/homebrew/bin/pyenv", version: Some("2.4.8"), tool: Pyenv }
    2024-07-26 15:08:11.202 [info] Discovered manager: (Pyenv) /opt/homebrew/bin/pyenv
    2024-07-26 15:08:11.202 [debug] Searching using locator: Venv
    2024-07-26 15:08:11.202 [debug] Completed searching using locator: Venv in 1.440666ms
    2024-07-26 15:08:11.202 [debug] Reporting Environment PythonEnvironment { display_name: None, name: None, executable: Some("/usr/local/bin/python3"), kind: Some(MacPythonOrg), version: Some("3.10.11"), prefix: Some("/Library/Frameworks/Python.framework/Versions/3.10"), manager: None, project: None, arch: None, symlinks: Some(["/Library/Frameworks/Python.framework/Versions/3.10/bin/python3", "/Library/Frameworks/Python.framework/Versions/3.10/bin/python3.10", "/Library/Frameworks/Python.framework/Versions/Current/bin/python3", "/Library/Frameworks/Python.framework/Versions/Current/bin/python3.10", "/usr/local/bin/python3", "/usr/local/bin/python3.10"]) }
    2024-07-26 15:08:11.202 [info] Discovered env: /usr/local/bin/python3
    2024-07-26 15:08:11.202 [debug] Completed searching using locator: MacPythonOrg in 1.922458ms
    2024-07-26 15:08:11.203 [debug] Reporting Environment PythonEnvironment { display_name: None, name: None, executable: Some("/Users/sagarg/.pyenv/versions/3.10.12/bin/python"), kind: Some(Pyenv), version: Some("3.10.12"), prefix: Some("/Users/sagarg/.pyenv/versions/3.10.12"), manager: Some(EnvManager { executable: "/opt/homebrew/bin/pyenv", version: Some("2.4.8"), tool: Pyenv }), project: None, arch: None, symlinks: Some(["/Users/sagarg/.pyenv/versions/3.10.12/bin/python", "/Users/sagarg/.pyenv/versions/3.10.12/bin/python3", "/Users/sagarg/.pyenv/versions/3.10.12/bin/python3.10"]) }
    2024-07-26 15:08:11.203 [info] Discovered env: /Users/sagarg/.pyenv/versions/3.10.12/bin/python
    2024-07-26 15:08:11.203 [debug] Executing 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}))
    2024-07-26 15:08:11.203 [debug] Reporting Environment PythonEnvironment { display_name: None, name: None, executable: Some("/Users/sagarg/.pyenv/versions/sigma2/bin/python"), kind: Some(PyenvVirtualEnv), version: Some("3.10.12"), prefix: Some("/Users/sagarg/.pyenv/versions/sigma2"), manager: Some(EnvManager { executable: "/opt/homebrew/bin/pyenv", version: Some("2.4.8"), tool: Pyenv }), project: None, arch: None, symlinks: Some(["/Users/sagarg/.pyenv/versions/sigma2/bin/python", "/Users/sagarg/.pyenv/versions/sigma2/bin/python3", "/Users/sagarg/.pyenv/versions/sigma2/bin/python3.10"]) }
    2024-07-26 15:08:11.203 [info] Discovered env: /Users/sagarg/.pyenv/versions/sigma2/bin/python
    2024-07-26 15:08:11.203 [debug] Completed searching using locator: PyEnv in 4.951542ms
    2024-07-26 15:08:11.203 [debug] Using cache from "/Users/sagarg/Library/Application Support/Code/User/globalStorage/ms-python.python/pythonLocator/31f2aee4e71d21fb.3.json" for "/usr/bin/python3"
    2024-07-26 15:08:11.203 [debug] Reporting Environment PythonEnvironment { display_name: None, name: None, executable: Some("/usr/bin/python3"), kind: Some(MacCommandLineTools), version: Some("3.9.6.final.0"), prefix: Some("/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9"), manager: None, project: None, arch: Some(X64), symlinks: Some(["/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/bin/python3", "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/bin/python3.9", "/Library/Developer/CommandLineTools/usr/bin/python3", "/Library/Developer/CommandLineTools/usr/bin/python3.9", "/usr/bin/python3"]) }
    2024-07-26 15:08:11.203 [info] Discovered env: /usr/bin/python3
    2024-07-26 15:08:11.203 [debug] Completed searching using locator: MacCommandLineTools in 7.816708ms
    2024-07-26 15:08:11.203 [debug] Time taken to get conda environment paths: 12.019ms
    2024-07-26 15:08:11.203 [debug] Completed searching using locator: Conda in 12.0565ms
    2024-07-26 15:08:11.204 [debug] Getting homebrew python info for "/opt/homebrew/bin/python3" => "/opt/homebrew/Cellar/python@3.12/3.12.4/Frameworks/Python.framework/Versions/3.12/bin/python3.12" with version Some("3.12.4")
    2024-07-26 15:08:11.222 [debug] Env ("/usr/bin/python3") in Path resolved as Some(MacCommandLineTools)
    2024-07-26 15:08:11.222 [debug] Reporting Environment PythonEnvironment { display_name: None, name: None, executable: Some("/opt/homebrew/bin/python3"), kind: Some(Homebrew), version: Some("3.12.4"), prefix: None, manager: None, project: None, arch: None, symlinks: Some(["/opt/homebrew/Cellar/python@3.12/3.12.4/Frameworks/Python.framework/Versions/3.12/bin/python3", "/opt/homebrew/Cellar/python@3.12/3.12.4/Frameworks/Python.framework/Versions/3.12/bin/python3.12", "/opt/homebrew/Cellar/python@3.12/3.12.4/Frameworks/Python.framework/Versions/Current/bin/python3", "/opt/homebrew/Cellar/python@3.12/3.12.4/Frameworks/Python.framework/Versions/Current/bin/python3.12", "/opt/homebrew/Cellar/python@3.12/3.12.4/bin/python3", "/opt/homebrew/Cellar/python@3.12/3.12.4/bin/python3.12", "/opt/homebrew/Frameworks/Python.framework/Versions/3.12/bin/python3", "/opt/homebrew/Frameworks/Python.framework/Versions/3.12/bin/python3.12", "/opt/homebrew/Frameworks/Python.framework/Versions/Current/bin/python3", "/opt/homebrew/Frameworks/Python.framework/Versions/Current/bin/python3.12", "/opt/homebrew/bin/python3", "/opt/homebrew/bin/python3.12", "/opt/homebrew/opt/python/bin/python3", "/opt/homebrew/opt/python/bin/python3.12", "/opt/homebrew/opt/python3/bin/python3", "/opt/homebrew/opt/python3/bin/python3.12", "/opt/homebrew/opt/python@3/bin/python3", "/opt/homebrew/opt/python@3/bin/python3.12", "/opt/homebrew/opt/python@3.12/bin/python3", "/opt/homebrew/opt/python@3.12/bin/python3.12"]) }
    2024-07-26 15:08:11.222 [info] Discovered env: /opt/homebrew/bin/python3
    2024-07-26 15:08:11.223 [debug] Getting homebrew python info for "/opt/homebrew/bin/python3.11" => "/opt/homebrew/Cellar/python@3.11/3.11.9_1/Frameworks/Python.framework/Versions/3.11/bin/python3.11" with version Some("3.11.9")
    2024-07-26 15:08:11.223 [debug] Reporting Environment PythonEnvironment { display_name: None, name: None, executable: Some("/opt/homebrew/bin/python3.11"), kind: Some(Homebrew), version: Some("3.11.9"), prefix: None, manager: None, project: None, arch: None, symlinks: Some(["/opt/homebrew/Cellar/python@3.11/3.11.9_1/Frameworks/Python.framework/Versions/3.11/bin/python3.11", "/opt/homebrew/Frameworks/Python.framework/Versions/3.11/bin/python3.11", "/opt/homebrew/bin/python3.11", "/opt/homebrew/opt/python@3.11/bin/python3.11"]) }
    2024-07-26 15:08:11.223 [info] Discovered env: /opt/homebrew/bin/python3.11
    2024-07-26 15:08:11.224 [debug] Getting homebrew python info for "/opt/homebrew/bin/python3.12" => "/opt/homebrew/Cellar/python@3.12/3.12.4/Frameworks/Python.framework/Versions/3.12/bin/python3.12" with version Some("3.12.4")
    2024-07-26 15:08:11.225 [debug] Resolving env "/opt/homebrew/bin/python3"
    2024-07-26 15:08:11.229 [debug] Resolving env "/opt/homebrew/bin/python3.11"
    2024-07-26 15:08:11.358 [debug] Getting homebrew python info for "/opt/homebrew/bin/python3" => "/opt/homebrew/Cellar/python@3.12/3.12.4/Frameworks/Python.framework/Versions/3.12/bin/python3.12" with version Some("3.12.4")
    2024-07-26 15:08:11.417 [debug] Getting homebrew python info for "/opt/homebrew/bin/python3.11" => "/opt/homebrew/Cellar/python@3.11/3.11.9_1/Frameworks/Python.framework/Versions/3.11/bin/python3.11" with version Some("3.11.9")
    2024-07-26 15:08:11.436 [debug] Using cache from "/Users/sagarg/Library/Application Support/Code/User/globalStorage/ms-python.python/pythonLocator/5c7b89af1651d0b8.3.json" for "/opt/homebrew/bin/python3.11"
    2024-07-26 15:08:11.440 [debug] In resolve_environment, Resolved Python Exe "/opt/homebrew/bin/python3.11" as ResolvedPythonEnv { executable: "/opt/homebrew/opt/python@3.11/bin/python3.11", prefix: "/opt/homebrew/opt/python@3.11/Frameworks/Python.framework/Versions/3.11", version: "3.11.9.final.0", is64_bit: true, symlinks: Some(["/opt/homebrew/bin/python3.11", "/opt/homebrew/opt/python@3.11/bin/python3.11"]) }
    2024-07-26 15:08:11.442 [debug] Resolved env (Ok(19.127ms)) "/opt/homebrew/bin/python3.11" as PythonEnvironment { display_name: None, name: None, executable: Some("/opt/homebrew/bin/python3.11"), kind: Some(Homebrew), version: Some("3.11.9.final.0"), prefix: Some("/opt/homebrew/opt/python@3.11/Frameworks/Python.framework/Versions/3.11"), manager: None, project: None, arch: Some(X64), symlinks: Some(["/opt/homebrew/Cellar/python@3.11/3.11.9_1/Frameworks/Python.framework/Versions/3.11/bin/python3.11", "/opt/homebrew/Frameworks/Python.framework/Versions/3.11/bin/python3.11", "/opt/homebrew/bin/python3.11", "/opt/homebrew/opt/python@3.11/bin/python3.11"]) }
    2024-07-26 15:08:11.899 [info] Resolved /opt/homebrew/bin/python3.11
    2024-07-26 15:08:11.901 [debug] Using cache from "/Users/sagarg/Library/Application Support/Code/User/globalStorage/ms-python.python/pythonLocator/b0fa6594d8f4cbf1.3.json" for "/opt/homebrew/bin/python3"
    2024-07-26 15:08:11.928 [debug] In resolve_environment, Resolved Python Exe "/opt/homebrew/bin/python3" as ResolvedPythonEnv { executable: "/opt/homebrew/opt/python@3.12/bin/python3.12", prefix: "/opt/homebrew/opt/python@3.12/Frameworks/Python.framework/Versions/3.12", version: "3.12.4.final.0", is64_bit: true, symlinks: Some(["/opt/homebrew/bin/python3", "/opt/homebrew/opt/python@3.12/bin/python3.12"]) }
    2024-07-26 15:08:11.939 [debug] Resolved env (Ok(20.053ms)) "/opt/homebrew/bin/python3" as PythonEnvironment { display_name: None, name: None, executable: Some("/opt/homebrew/bin/python3"), kind: Some(Homebrew), version: Some("3.12.4.final.0"), prefix: Some("/opt/homebrew/opt/python@3.12/Frameworks/Python.framework/Versions/3.12"), manager: None, project: None, arch: Some(X64), symlinks: Some(["/opt/homebrew/Cellar/python@3.12/3.12.4/Frameworks/Python.framework/Versions/3.12/bin/python3", "/opt/homebrew/Cellar/python@3.12/3.12.4/Frameworks/Python.framework/Versions/3.12/bin/python3.12", "/opt/homebrew/Cellar/python@3.12/3.12.4/Frameworks/Python.framework/Versions/Current/bin/python3", "/opt/homebrew/Cellar/python@3.12/3.12.4/Frameworks/Python.framework/Versions/Current/bin/python3.12", "/opt/homebrew/Cellar/python@3.12/3.12.4/bin/python3", "/opt/homebrew/Cellar/python@3.12/3.12.4/bin/python3.12", "/opt/homebrew/Frameworks/Python.framework/Versions/3.12/bin/python3", "/opt/homebrew/Frameworks/Python.framework/Versions/3.12/bin/python3.12", "/opt/homebrew/Frameworks/Python.framework/Versions/Current/bin/python3", "/opt/homebrew/Frameworks/Python.framework/Versions/Current/bin/python3.12", "/opt/homebrew/bin/python3", "/opt/homebrew/bin/python3.12", "/opt/homebrew/opt/python/bin/python3", "/opt/homebrew/opt/python/bin/python3.12", "/opt/homebrew/opt/python3/bin/python3", "/opt/homebrew/opt/python3/bin/python3.12", "/opt/homebrew/opt/python@3/bin/python3", "/opt/homebrew/opt/python@3/bin/python3.12", "/opt/homebrew/opt/python@3.12/bin/python3", "/opt/homebrew/opt/python@3.12/bin/python3.12"]) }
    2024-07-26 15:08:11.944 [info] Resolved /opt/homebrew/bin/python3
    2024-07-26 15:08:11.948 [debug] Getting homebrew python info for "/opt/homebrew/bin/python3.12" => "/opt/homebrew/Cellar/python@3.12/3.12.4/Frameworks/Python.framework/Versions/3.12/bin/python3.12" with version Some("3.12.4")
    2024-07-26 15:08:11.951 [debug] Getting homebrew python info for "/opt/homebrew/bin/python3.11" => "/opt/homebrew/Cellar/python@3.11/3.11.9_1/Frameworks/Python.framework/Versions/3.11/bin/python3.11" with version Some("3.11.9")
    2024-07-26 15:08:11.951 [debug] Completed searching using locator: Homebrew in 67.102791ms
    ``
  14. DonJayamanne commented on Jul 26, 2024

    @DonJayamanne
    Collaborator

    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}))"
    • Also, when you run the last command in the terminal, do you notice a CPU spike
  15. sagargg commented on Jul 28, 2024

    @sagargg
    Author

    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?
    Screenshot 2024-07-28 at 7 15 08 AM

  16. DonJayamanne commented on Jul 30, 2024

    @DonJayamanne
    Collaborator

    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.

    Closing as this isn't caused by the finder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions