vscode-python: integreted powershell's PATH env variables contains unexpected '.'
- VS Code Version: 1.82.2 (user setup)
- OS Version: Windows_NT x64 10.0.19045
Steps to Reproduce:
- open the integreted powershell.
- run any command.
This is a very weird issue that integreted powershell doesn’t share the same PATH env variables with the outside powershell 7. I installed anaconda, mainly for python dev. Debugging python codes with vscode integreted powershell is successful, but when i wanna use the integreted powershell to do other works(e.g. pip install a whl), it always turns out to be “set-Item: Cannot find drive. A drive with the name ‘.D’ does not exist.” error. Last time i saw this kind of error, i found " ‘.C’ does not exist", and i checked the $env:PATH, find a value is written ‘.C:/(…)’, i used set-Item command removed the value and it started to work properly. But after a rebooting my computer, it turns out to be the same with “Cannot find drive. A drive with the name ‘.D’ does not exist”. however, this time i cannot use set-Item to fix it, the error report is the same ‘Cannot find drive’. The $env:PATH has a lot of dumplicates since a .D occurred, and I cannot remove the .D line anymore. This issue is quite similar to microsoft/vscode#74606, but i don’t know if they are really the same.
the outside powershell 7’s $env:PATH: C:\Program Files\PowerShell\7;D:\anaconda3\Scripts;D:\anaconda3\envs\tf-gpu\Library\bin;C:\Windows\system32;D:\Git\cmd;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.0\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.0\libnvvp;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\OpenSSH;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\NVIDIA Corporation\Nsight Compute 2022.4.0;C:\Program Files\PowerShell\7;C:\Users\liquid\AppData\Local\Microsoft\WindowsApps;D:\Microsoft VS Code\bin
the integreted powershell 7’s $env:PATH: C:\Program Files\PowerShell\7;D:\anaconda3\envs\tf-gpu;D:\anaconda3\envs\tf-gpu\Library\mingw-w64\bin;D:\anaconda3\envs\tf-gpu\Library\usr\bin;D:\anaconda3\envs\tf-gpu\Library\bin;D:\anaconda3\envs\tf-gpu\Scripts;D:\anaconda3\envs\tf-gpu\bin;D:\anaconda3\condabin;C:\Program Files\PowerShell\7;D:\anaconda3\Scripts;D:\anaconda3\envs\tf-gpu\Library\bin;C:\Windows\system32;D:\Git\cmd;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.0\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.0\libnvvp;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\OpenSSH;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\NVIDIA Corporation\Nsight Compute 2022.4.0;C:\Program Files\PowerShell\7;C:\Users\liquid\AppData\Local\Microsoft\WindowsApps;D:\anaconda3\envs\tf-gpu\Library\bin;D:\anaconda3\Scripts;D:\Microsoft VS Code\bin;.D:\anaconda3\Scripts;D:\anaconda3\envs\tf-gpu\Library\bin;C:\Windows\system32;D:\Git\cmd;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.0\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.0\libnvvp;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\OpenSSH;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\NVIDIA Corporation\Nsight Compute 2022.4.0;C:\Program Files\PowerShell\7;C:\Users\liquid\AppData\Local\Microsoft\WindowsApps;D:\anaconda3\envs\tf-gpu\Library\bin;D:\anaconda3\Scripts;D:\Microsoft VS Code\bin; the ‘.D’ is with '.D:\anaconda3\Scripts'
About this issue
- Original URL
- State: closed
- Created 9 months ago
- Reactions: 2
- Comments: 15
@karrtikr Sorry for the confusion, it’s working now. I probably forgot to reload everything.
Hi all, Fix should be out in the pre-release version of the extension, use the following to try it out:
Dup of https://github.com/microsoft/vscode-python/issues/22047.
This feature is currently behind an experiment, feel free to add the following User setting to temporarily opt out:
We plan to make this the default experience going forward, and would very much appreciate it if you could help with the specifics which makes it hard to follow, or any other feedback to improve it.
That’s currently a limitation we’re hoping to solve in the future with https://github.com/microsoft/vscode/issues/145234. But things should still work as expected even with the limiation.