-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
Type: Bug
Behaviour
Python does not properly/consistently contributed to Powershell environment. Two PCs with VS Code and Anaconda installations today with differing behaviors.
Steps to reproduce:
On PC 1:
- Start VS Code from Windows Start Menu
- Python in an Anaconda environment is already selected under Python: Select Interpreter
- Open Powershell terminal
- Hover over Powershell tab: See "Environment of PC 1" below
- Type in pip
- pip help is shown
All OK apart from the small fact that the Python virtual environment is not indicated in the Powershell prompt.
On PC 2:
- Start VS Code from Windows Start Menu
- Python in an Anaconda environment is already selected under Python: Select Interpreter
- Open Powershell terminal
- Hover over Powershell tab: See "Environment of PC 2" below.
- Type in pip
- Error message: pip : The term 'pip' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
Not OK.
- Quit VS Code
- In Anaconda prompt: conda activate ETH_CAS_AIS_2024_py310
- In Anaconda prompt: code
- VS Code is launched
- Open Powershell terminal
- Hover over Powershell tab: See "Environment of PC 2" below.
- Type in pip
- pip help is shown
All OK but steps 10 to 17 are probably indicative on what's going astray within VS Code.
- Quit and restart VS Code
- Open Powershell terminal
- Hover over Powershell tab: See "Environment of PC 2" below.
- Error message:
PS C:\Users\Marcel> C:/Users/Marcel/anaconda3/Scripts/activate
PS C:\Users\Marcel> conda activate ETH_CAS_AIS_2024_py310
conda : The term 'conda' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
conda activate ETH_CAS_AIS_2024_py310
CategoryInfo : ObjectNotFound: (conda:String) [], CommandNotFoundException
FullyQualifiedErrorId : CommandNotFoundException
All not OK again.
Diagnostic data
Hovering over Powershell tab at each indicated step:
Powershell Environment of PC 1:
Terminal Environment Changes
Extension: ms-python.python
Activated environment for ~\anaconda3\envs\ETH_CAS_AIS_2024_py310\python.exe
CONDA_DEFAULT_ENV=ETH_CAS_AIS_2024_py310
CONDA_EXE=C:\Users\Marcel\anaconda3\Scripts\conda.exe
CONDA_PREFIX=C:\Users\Marcel\anaconda3\envs\ETH_CAS_AIS_2024_py310
CONDA_PROMPT_MODIFIER=(ETH_CAS_AIS_2024_py310)
CONDA_PYTHON_EXE=C:\Users\Marcel\anaconda3\python.exe
CONDA_ROOT=C:\Users\Marcel\anaconda3
CONDA_SHLVL=1
PATH=C:\Users\Marcel\anaconda3\envs\ETH_CAS_AIS_2024_py310;C:\Users\Marcel\anaconda3\envs\ETH_CAS_AIS_2024_py310\Library\mingw-w64\bin;C:\Users\Marcel\anaconda3\envs\ETH_CAS_AIS_2024_py310\Library\usr\bin;C:\Users\Marcel\anaconda3\envs\ETH_CAS_AIS_2024_py310\Library\bin;C:\Users\Marcel\anaconda3\envs\ETH_CAS_AIS_2024_py310\Scripts;C:\Users\Marcel\anaconda3\envs\ETH_CAS_AIS_2024_py310\bin;C:\Users\Marcel\anaconda3\condabin;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;c:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;c:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Git\cmd;C:\Users\Marcel\AppData\Local\Microsoft\WindowsApps;C:\Users\Marcel\AppData\Local\Programs\Microsoft VS Code\bin;${env:PATH}
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.CPL
PROMPT=(ETH_CAS_AIS_2024_py310) $P$G
PSMODULEPATH=C:\DATEN\My Documents\WindowsPowerShell\Modules;C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules
PYTHONIOENCODING=utf-8
PYTHONUNBUFFERED=1
_CONDA_OLD_CHCP=437
Extension: vscode.git
Enables the following features: git auth provider
GIT_ASKPASS=c:\Users\Marcel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\git\dist\askpass.sh
VSCODE_GIT_ASKPASS_NODE=C:\Users\Marcel\AppData\Local\Programs\Microsoft VS Code\Code.exe
VSCODE_GIT_ASKPASS_EXTRA_ARGS=
VSCODE_GIT_ASKPASS_MAIN=c:\Users\Marcel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\git\dist\askpass-main.js
VSCODE_GIT_IPC_HANDLE=\\.\pipe\vscode-git-7cb2a134d4-sock
Powershell Environment of PC 2:
Terminal Environment Changes
Extension: vscode.git
Enables the following features: git auth provider
GIT_ASKPASS=c:\Users\Marcel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\git\dist\askpass.sh
VSCODE_GIT_ASKPASS_NODE=C:\Users\Marcel\AppData\Local\Programs\Microsoft VS Code\Code.exe
VSCODE_GIT_ASKPASS_EXTRA_ARGS=
VSCODE_GIT_ASKPASS_MAIN=c:\Users\Marcel\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\git\dist\askpass-main.js
VSCODE_GIT_IPC_HANDLE=\\.\pipe\vscode-git-4d8f1d6a52-sock
Additional information
PC 1:
Extension version: 2024.4.0
VS Code version: Code 1.88.0 (5c3e652f63e798a5ac2f31ffd0d863669328dc4c, 2024-04-03T13:26:18.741Z)
OS version: Windows_NT x64 10.0.19045
Modes:
- Python version (& distribution if applicable, e.g. Anaconda): 3.10.13
- Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Conda
- Value of the
python.languageServer
setting: Default
User Settings
languageServer: "Pylance"
Installed Extensions
Extension Name | Extension Id | Version |
---|---|---|
JavaScript Debugger | ms-vscode.js-debug | 1.88.0 |
JavaScript Debugger Companion Extension | ms-vscode.js-debug-companion | 1.1.2 |
Jupyter | ms-toolsai.jupyter | 2024.3.0 |
Jupyter Cell Tags | ms-toolsai.vscode-jupyter-cell-tags | 0.1.9 |
Jupyter Keymap | ms-toolsai.jupyter-keymap | 1.1.2 |
Jupyter Notebook Renderers | ms-toolsai.jupyter-renderers | 1.0.17 |
Jupyter Slide Show | ms-toolsai.vscode-jupyter-slideshow | 0.1.6 |
Pylance | ms-python.vscode-pylance | 2024.4.1 |
Python | ms-python.python | 2024.4.0 |
Python Debugger | ms-python.debugpy | 2024.2.0 |
Table Visualizer for JavaScript Profiles | ms-vscode.vscode-js-profile-table | 1.0.8 |
System Info
Item | Value |
---|---|
CPUs | Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz (8 x 1992) |
GPU Status | 2d_canvas: enabled canvas_oop_rasterization: enabled_on direct_rendering_display_compositor: disabled_off_ok gpu_compositing: enabled multiple_raster_threads: enabled_on opengl: enabled_on rasterization: enabled raw_draw: disabled_off_ok skia_graphite: disabled_off video_decode: enabled video_encode: enabled vulkan: disabled_off webgl: enabled webgl2: enabled webgpu: enabled |
Load (avg) | undefined |
Memory (System) | 15.82GB (9.08GB free) |
Process Argv | --crash-reporter-id 616eeb58-e3f2-48ba-ab71-98063679351e |
Screen Reader | no |
VM | 0% |
A/B Experiments
vsliv368cf:30146710
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscoreces:30445986
vscod805cf:30301675
binariesv615:30325510
vsaa593cf:30376535
py29gd2263:30899288
c4g48928:30535728
azure-dev_surveyone:30548225
962ge761:30959799
pythongtdpath:30769146
welcomedialogc:30910334
pythonidxpt:30866567
pythonnoceb:30805159
asynctok:30898717
pythontestfixt:30902429
pythonregdiag2:30936856
pyreplss1:30897532
pythonmypyd1:30879173
pythoncet0:30885854
2e7ec940:31000449
pythontbext0:30879054
accentitlementst:30995554
dsvsc016:30899300
dsvsc017:30899301
dsvsc018:30899302
bf62j303:30959262
cppperfnew:31000557
d34g3935:30971562
fegfb526:30981948
bg6jg535:30979843
ccp2r3:30993541
dsvsc020:30976470
pythonait:31006305
gee8j676:31009558
dsvsc021:30996838
gd77d436:30999572
PC 2:
Extension version: 2024.4.0
VS Code version: Code 1.88.0 (5c3e652f63e798a5ac2f31ffd0d863669328dc4c, 2024-04-03T13:26:18.741Z)
OS version: Windows_NT x64 10.0.19045
Modes:
- Python version (& distribution if applicable, e.g. Anaconda): 3.10.13
- Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Conda
- Value of the
python.languageServer
setting: Default
User Settings
languageServer: "Pylance"
Installed Extensions
Extension Name | Extension Id | Version |
---|---|---|
All Autocomplete | Atishay-Jain.All-Autocomplete | 0.0.26 |
JavaScript Debugger | ms-vscode.js-debug | 1.88.0 |
JavaScript Debugger Companion Extension | ms-vscode.js-debug-companion | 1.1.2 |
Jupyter | ms-toolsai.jupyter | 2024.3.0 |
Jupyter Cell Tags | ms-toolsai.vscode-jupyter-cell-tags | 0.1.9 |
Jupyter Keymap | ms-toolsai.jupyter-keymap | 1.1.2 |
Jupyter Notebook Renderers | ms-toolsai.jupyter-renderers | 1.0.17 |
Jupyter Slide Show | ms-toolsai.vscode-jupyter-slideshow | 0.1.6 |
Markdown All in One | yzhang.markdown-all-in-one | 3.6.2 |
Pylance | ms-python.vscode-pylance | 2024.4.1 |
Python | ms-python.python | 2024.4.0 |
Python Debugger | ms-python.debugpy | 2024.2.0 |
Spell Right | ban.spellright | 3.0.122 |
Table Visualizer for JavaScript Profiles | ms-vscode.vscode-js-profile-table | 1.0.8 |
System Info
Item | Value |
---|---|
CPUs | Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz (16 x 3600) |
GPU Status | 2d_canvas: enabled canvas_oop_rasterization: enabled_on direct_rendering_display_compositor: disabled_off_ok gpu_compositing: enabled multiple_raster_threads: enabled_on opengl: enabled_on rasterization: enabled raw_draw: disabled_off_ok skia_graphite: disabled_off video_decode: enabled video_encode: enabled vulkan: disabled_off webgl: enabled webgl2: enabled webgpu: enabled |
Load (avg) | undefined |
Memory (System) | 31.91GB (18.97GB free) |
Process Argv | |
Screen Reader | yes |
VM | 0% |