12

When I start Visual Studio Code with a python file I started getting the following error

The environment variable 'Path' seems to have 
some paths containing characters (';', '"' or ';;'). 
The existence of such characters are known to have 
caused the Python extension to not load. If the 
extension fails to load please modify your paths to 
remove these characters.

I checked my path and I did indeed have a ;; appearing. I removed it but, I'm still getting the error.

Here is my current path.

PATH=C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Common Files\Lenovo;C:\SWTOOLS\ReadyApps;C:\Program Files\Calibre2\;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\Skype\Phone\;C:\Program Files\IDM Computer Solutions\UltraEdit;C:\Users\Dave\.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files\Git\cmd;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\Sophos\Sophos SSL VPN Client\bin;C:\Users\Dave\AppData\Local\atom\bin;C:\Users\Dave\AppData\Local\Microsoft\WindowsApps;C:\sqlite;C:\Python36\Scripts;C:\Program Files\Microsoft VS Code\bin;C:\Python36;
Sushant Rajbanshi
  • 1,985
  • 1
  • 19
  • 20
dl__
  • 4,500
  • 5
  • 28
  • 34

7 Answers7

12

Your local PATH contains the following folder paths in this order:

C:\ProgramData\Oracle\Java\javapath
C:\Program Files (x86)\Intel\iCLS Client\
C:\Program Files\Intel\iCLS Client\
C:\WINDOWS\system32
C:\WINDOWS
C:\WINDOWS\System32\Wbem
C:\WINDOWS\System32\WindowsPowerShell\v1.0\
C:\Program Files\Intel\Intel(R) Management Engine Components\DAL
C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL
C:\Program Files\Intel\Intel(R) Management Engine Components\IPT
C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT
C:\Program Files (x86)\Common Files\Lenovo
C:\SWTOOLS\ReadyApps
C:\Program Files\Calibre2\
c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\
c:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\
C:\Program Files (x86)\Skype\Phone\
C:\Program Files\IDM Computer Solutions\UltraEdit
C:\Users\Dave\.dnx\bin
C:\Program Files\Microsoft DNX\Dnvm\
C:\Program Files\Git\cmd
C:\WINDOWS\System32\OpenSSH\
C:\Program Files\Intel\WiFi\bin\
C:\Program Files\Common Files\Intel\WirelessCommon\
C:\Program Files (x86)\Sophos\Sophos SSL VPN Client\bin
C:\Users\Dave\AppData\Local\atom\bin
C:\Users\Dave\AppData\Local\Microsoft\WindowsApps
C:\sqlite
C:\Python36\Scripts
C:\Program Files\Microsoft VS Code\bin
C:\Python36

So in local PATH there is no folder path included being surrounded by double quotes and there is also no path containing a semicolon nor are there two semicolons.

Folder paths in PATH should not end with a backslash. It is possible and Microsoft itself added PowerShell folder path with a trailing backslash by default to system PATH. But I recommend fixing that in advanced system settings of Windows system control panel.

There should be no semicolon after last folder path of system PATH and user PATH. Some not good coded applications or scripts append folder paths to local PATH with always a semicolon at beginning without checking first if PATH ends already with a semicolon. This results in local PATH containing finally ;;. The semicolon after C:\Python36 should be removed for that reason.

And the first four folder paths in system PATH should be always:

%SystemRoot%\system32
%SystemRoot%
%SystemRoot%\System32\Wbem
%SystemRoot%\System32\WindowsPowerShell\v1.0

This means the system PATH as shown in environment variables dialog and stored in Windows registry should start always with:

%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SystemRoot%\System32\WindowsPowerShell\v1.0

Some not good coded installers insert folder paths before the most important folder path – the Windows system folder. That should be fixed by you, too.

I suppose the issue is caused by ; after C:\Python36 with a batch file containing just the command line:

set "PATH=%PATH%;C:\Folder Path"

Or a batch file contains the command line:

set PATH="%PATH%;C:\Folder Path"

That command line corrupts the local PATH environment variable because of changing the semicolon separated list of folder paths into one invalid folder path.

See also:

Mofi
  • 46,139
  • 17
  • 80
  • 143
1

For me it was just a \ in the end of the Python path:

C:\Users\ME\AppData\Local\Programs\Python\Python37\Scripts\

The moment I removed the last \ the warning went off !

Stephen Rauch
  • 47,830
  • 31
  • 106
  • 135
DanD
  • 46
  • 2
1

I met this question and i don't know how to do: 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.

Aegon
  • 21
  • 4
1

i have faced issue and just uninstalled all extensions in VS and installed again then working fine.

1

I had the same issue. Comes out I had an empty string "" in the paths. What solved it for me was, and might not be the case for all. In terminal

import sys
print(sys.path) # lists all the paths, "returns a list" 

Next: Find the index position and modify the list by removing the empty string using

del sys.path[index] #(for me del sys.path[0])

restart VSCode that worked for me.

Daraan
  • 1,797
  • 13
  • 24
sandeep
  • 11
  • 2
0

Check the INTERPRETER inside Visual Studio with the command CTRL +P and choose the correct PATH if you are in the enter image description hereCONDA environment choose it

0

error corrected somehow, just re-install the plugins. It won't show the path error again.

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Apr 04 '22 at 21:55