Skip to content

Activating extension 'ms-python.vscode-python-envs' failed: The "paths[1]" argument must be of type string. Received undefined. #951

Description

As shown in the question, I have been encountering this problem since several versions ago.

As long as I am using the Python extension plugin , at the same time, enable vscode python environments .The error will be as follows:

Extension activation failed, run the 'Developer: Toggle Developer Tools' command for more information.

The specific error information is displayed in Developer Tools as follows, and the complete error information is provided in the attachment.

log.docx

log.ts:440 INFO Started local extension host with pid 10308.
log.ts:440 INFO MCP Registry configured: https://api.mcp.github.com/2025-09-15
log.ts:440 INFO Settings Sync: Account status changed from uninitialized to available
mainThreadExtensionService.ts:107 Activating extension 'ms-python.vscode-python-envs' failed: The "paths[1]" argument must be of type string. Received undefined.
$onExtensionActivationError @ mainThreadExtensionService.ts:107
notificationsAlerts.ts:42 Extension activation failed, run the 'Developer: Toggle Developer Tools' command for more information.
c @ notificationsAlerts.ts:42
mainThreadExtensionService.ts:107 Activating extension 'ms-python.python' failed: Activating extension 'ms-python.vscode-python-envs' failed: The "paths[1]" argument must be of type string. Received undefined..
$onExtensionActivationError @ mainThreadExtensionService.ts:107
log.ts:440 INFO [perf] Render performance baseline is 15ms
log.ts:460 ERR [Extension Host] (node:10308) ExperimentalWarning: SQLite is an experimental feature and might change at any time
(Use Code --trace-warnings ... to show where the warning was created)
error @ log.ts:460
console.ts:137 [Extension Host] (node:10308) ExperimentalWarning: SQLite is an experimental feature and might change at any time
(Use Code --trace-warnings ... to show where the warning was created)
gbs @ console.ts:137
log.ts:460 ERR chatParticipant must be declared in package.json: claude-code
error @ log.ts:460
webviewElement.ts:489 An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can escape its sandboxing.
mountTo @ webviewElement.ts:489
notificationsAlerts.ts:42 command 'python-envs.set' not found
c @ notificationsAlerts.ts:42
webviewElement.ts:489 An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can escape its sandboxing.
mountTo @ webviewElement.ts:489
webviewElement.ts:489 An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can escape its sandboxing.
mountTo @ webviewElement.ts:489

I don't know what's going on, even though I searched for a lot of information online, I couldn't solve it. Please give me some help, thank you very much!

Activity

  1. eleanorjboyd commented on Oct 23, 2025

    @eleanorjboyd
    Member

    Thank you for the comprehensive issue and Im sorry you are facing this problem. I will take a look!

  2. eleanorjboyd commented on Oct 23, 2025

    @eleanorjboyd
    Member

    Hello! Taking a look at this now, I haven't seen anything like this so bear with me as I have a few questions to narrow it down:

    1. what are versions do you have for the python and python environments extension? does upgrading to the latest pre-release of both change anything?
    2. Does anything happen if you uninstall then reinstall the python environments extension?
    3. What is your workspace setup? If you open a blank folder you see this problem still?
    4. What do you have installed on your machine in terms of python environments and executables? Conda ? different python versions?
    5. Can you check if you have any settings (at the workspace or user level) defined that related to python paths? Maybe defaultInterpreterPath, venvFolders, venvPath, condaPath or anything similar to these.
      Thanks and hopefully we can get this figured out
  3. DesenbergChina commented on Oct 24, 2025

    @DesenbergChina
    Author

    Thank you for your reply! The more infomation will be as follows:

    1. upgrading to the latest pre-release doesn't change anything. Now their versions are : ms-python.python 2025.16.0 ms-python.vscode-python-envs:1.10.0
    2. uninstalling then reinstall the python environments extension is useless.
    3. My workspace setup is default, and I haven't modified it. if I open a blank folder and then new .py file, this bug still happen.
    4. python 3.13.7 and python 3.10.11 are python versions on my machine. No Conda or others.
    5. command 'python-envs.set' not found will appear, when I want to set the python interpreter path. defaultInterpreterPath is D:\APP\Python3\python.exe. I don't think there's any problem.
  4. eleanorjboyd commented on Oct 28, 2025

    @eleanorjboyd
    Member

    Hm very interesting. First can you try running "Python: Run Python Environment Tool (PET) in Terminal..." and select "find" does that work and what does it output? Also if you un-install the python environments extension does this error message disappear?

  5. DesenbergChina commented on Oct 29, 2025

    @DesenbergChina
    Author

    I try running "Python: Run Python Environment Tool (PET) in Terminal...", will be report an erro that is shown in the picture below:
    Image

    if I un-install or disable the python environments extension, this error message disappear.

    Oh, this is really tricky!

  6. eleanorjboyd commented on Oct 29, 2025

    @eleanorjboyd
    Member

    So does it no longer happen at all if you uninstall and re-install or does it re-appear?

  7. github-actions commented on Nov 13, 2025

    @github-actions

    Because we have not heard back with the information we requested, we are closing this issue for now. If you are able to provide the info later on, then we will be happy to re-open this issue to pick up where we left off.

    Happy Coding!

  8. DesenbergChina commented on Nov 13, 2025

    @DesenbergChina
    Author

    if i uninstall and re-install , and then it re-appear

  9. noamnelke commented on Jan 2, 2026

    @noamnelke

    I think I had the same issue and was able to sort it out.

    In settings.json there's a key "python-envs.pythonProjects". For me this key was set to a list with a single empty object in it. I put some value in this object and restarted the extensions and now everything works.

    Hope it helps Desenberg (@DesenbergChina) (if you're still experiencing this) and hope it helps Eleanor Boyd (@eleanorjboyd) and team handle this better for everyone.

  10. eleanorjboyd commented on Jan 5, 2026

    @eleanorjboyd
    Member

    aha great find Noam Nelke (@noamnelke)! Let me get in a fix to catch that error.

  11. DesenbergChina commented on Jan 12, 2026

    @DesenbergChina
    Author

    Thanks. Now I have solved the problem by deleting cache and files of this extension completely(all of related files) and re-install, this problem disappeared. I found that simply uninstalling the extension within VSCode doesn't actually remove all the related files and folders

  12. locked as resolved and limited conversation to collaborators on Apr 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugIssue identified by VS Code Team member as probable bugtriage-needed

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions