Skip to content

Wrong environment variable information was read #16284

Description

Does this issue occur when all extensions are disabled?: Yes/No

  • VS Code Version: 1.56.2
  • OS Version: Windows 10 Professional 21H1 19043.985

Steps to Reproduce:

when active Python extension. will show this message:

The environment variable 'Path' seems to have some paths containing the '"' character. 
The existence of such a character is known to have caused the Python extension to not load. 
If the extension fails to load please modify your paths to remove this '"' character.

image

I checked my environment variable configuration and found no " characters .
Below is the result:

C:\Program Files (x86)\Common Files\Oracle\Java\javapath
H:\apps\Python27\
H:\apps\Python27\Scripts
C:\WINDOWS\system32
C:\WINDOWS
C:\WINDOWS\System32\Wbem
C:\WINDOWS\System32\WindowsPowerShell\v1.0\
C:\WINDOWS\System32\OpenSSH\
C:\Program Files\dotnet\
C:\Program Files\Microsoft SQL Server\130\Tools\Binn\
C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\
H:\apps\Amazon Corretto\jdk15.0.2_7\bin
H:\apps\apache-maven-3.6.3\bin
H:\apps\go\bin
C:\Users\jroger\AppData\Roaming\npm
H:\apps\TortoiseSVN\bin
H:\apps\dotnet-core-uninstall\
C:\Program Files\Git\cmd
C:\Program Files\Docker\Docker\resources\bin
C:\ProgramData\DockerDesktop\version-bin
C:\Program Files (x86)\Microsoft SQL Server\150\DTS\Binn\
H:\apps\mingw64\bin
H:\tools
C:\Program Files\nodejs\
C:\Users\jroger\AppData\Local\Microsoft\WindowsApps
H:\apps\Bandizip\
C:\Users\jroger\.dotnet\tools
C:\Users\jroger\AppData\Local\Programs\Microsoft VS Code\bin
H:\apps\Amazon Corretto\jdk15.0.2_7\bin
H:\apps\apache-maven-3.6.3\bin
H:\apps\go\bin
H:\apps\mingw64\bin
H:\tools
C:\Users\jroger\AppData\Roaming\npm
"d:\rmlis6\common"
C:\Program Files (x86)\Common Files\Oracle\Java\javapath
H:\apps\Python27\
H:\apps\Python27\Scripts
C:\WINDOWS\system32
C:\WINDOWS
C:\WINDOWS\System32\Wbem
C:\WINDOWS\System32\WindowsPowerShell\v1.0\
C:\WINDOWS\System32\OpenSSH\
C:\Program Files\dotnet\
C:\Program Files\Microsoft SQL Server\130\Tools\Binn\
C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\
H:\apps\Amazon Corretto\jdk15.0.2_7\bin
H:\apps\apache-maven-3.6.3\bin
H:\apps\go\bin
C:\Users\jroger\AppData\Roaming\npm
H:\apps\TortoiseSVN\bin
H:\apps\dotnet-core-uninstall\
C:\Program Files\Git\cmd
C:\Program Files\Docker\Docker\resources\bin
C:\ProgramData\DockerDesktop\version-bin
C:\Program Files (x86)\Microsoft SQL Server\150\DTS\Binn\
H:\apps\mingw64\bin
H:\tools
C:\Program Files\nodejs\

"d:\rmlis6\common" is not in my environment PATH. I'm very sure.
I don’t know where it was read from.

Activity

  1. added
    triage-neededNeeds assignment to the proper sub-team
    bugIssue identified by VS Code Team member as probable bug
    on May 20, 2021
  2. kimadeline commented on May 20, 2021

    @kimadeline

    What command did you use to display this list of paths? Where did you run it from?

  3. netcore-jroger commented on May 21, 2021

    @netcore-jroger
    Author

    I used .NET Interactive Notebooks extensions. And run csharp code:

    Action<string> log = message => Console.WriteLine(message);
    var path = Environment.GetEnvironmentVariable("PATH");
    var pathArray = path.Split(";", StringSplitOptions.None);
    foreach( var p in pathArray ){
      log(p);
    }
  4. kimadeline commented on May 31, 2021

    @kimadeline

    What do you get if you try to get environment variables from your terminal directly, for example using the Get-ChildItem -Path Env: command in PowerShell?

    What is the output when you open the Python REPL in your terminal and try to get environment variables in Python?

    import os
    
    os.environ
  5. netcore-jroger commented on Jun 1, 2021

    @netcore-jroger
    Author

    I did not find the problem using powershell, but I did see the problem using python. But it is not configured in my environment variables.

    image

    image

  6. netcore-jroger commented on Jun 1, 2021

    @netcore-jroger
    Author

    image

    why?

  7. netcore-jroger commented on Jun 1, 2021

    @netcore-jroger
    Author

    image

  8. kimadeline commented on Jun 1, 2021

    @kimadeline

    Moving your question to GitHub discussions since it's Python-related, and not an extension issue.

  9. locked and limited conversation to collaborators on Jun 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area-editor-*User-facing catch-allbugIssue identified by VS Code Team member as probable buginfo-neededIssue requires more information from poster

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions