profile
viewpoint

Ask questionsConda/Jupyter issue error: "StdErr from ShellExec, 'Analysis'..."

Bug: Notebook Editor, Interactive Window, Editor cells

<!----------------------------------------------------------------------------------------------- PLEASE READ If this issue doesn't relate to Jupyter Notebooks, Python Interactive Window features or other notebook or "cell"-based features of the Python extension, please use the main Python bug template instead of this one. Thank you! ------------------------------------------------------------------------------------------------->

Steps to cause the bug to occur

  1. Installed VSCode and Miniconda3 on Windows 10, making sure to add Miniconda3 to the PATH env variable
  2. installed python extension for vscode
  3. Created new conda env:
conda create -n itp_2020 python=3.6 jupyter scikit-learn seaborn pandas xlrd
  1. selected itp_2020 python interpreter
  2. opened existing/ created new ipynb and executed any cell

Actual behavior

Get the following error:

StdErr from ShellExec, 'Analysis' is not recognized as an internal or external command, operable program or batch file. for C:/Users/bianc/miniconda3/Scripts/activate && conda activate itp_2020 && echo 'e8b39361-0157-4923-80e1-22d70d46dee6' && python c:\Users\bianc\.vscode\extensions\ms-python.python-2020.6.90262\pythonFiles\pyvsc-run-isolated.py c:/Users/bianc/.vscode/extensions/ms-python.python-2020.6.90262/pythonFiles/printEnvVariables.py

Expected behavior

Successfully start jupyter server and execute cell. <!----------------------------------------------------------------------------------------------- Animated GIFs can be effective means to describe a bug. Consider using a tool like https://github.com/phw/peek or https://www.screentogif.com/ to create one. ------------------------------------------------------------------------------------------------->

Your Jupyter and/or Python environment

Please provide as much info as you readily know

  • Jupyter server running: Local
  • Extension version: v2020.6.90262
  • VS Code version: 1.46.1
  • Setting python.jediEnabled: false
  • Setting python.languageServer: Jedi
  • Python and/or Anaconda version: miniconda3: 4.8.3 (python: 3.7.7.final.0)
  • OS: Windows | Mac | Linux (distro): Windows 10
  • Virtual environment: conda

Developer Tools Console Output

<!----------------------------------------------------------------------------------------------- Copy/paste the output in the "Console" tab in the "Developer Tools" panel (Help > Toggle Developer Tools). For better details, run the "Enable source map support for extension debugging" command in VS Code at least once beforehand. -------------------------------------------------------------------------------------------------> [Extension Host] Info Python Extension: 2020-06-28 00:15:28: Activating Environment to capture Environment variables, C:/Users/bianc/miniconda3/Scripts/activate && conda activate itp_2020 && echo 'e8b39361-0157-4923-80e1-22d70d46dee6' && python c:\Users\bianc.vscode\extensions\ms-python.python-2020.6.90262\pythonFiles\pyvsc-run-isolated.py c:/Users/bianc/.vscode/extensions/ms-python.python-2020.6.90262/pythonFiles/printEnvVariables.py console.ts:137 [Extension Host] Error Python Extension: 2020-06-28 00:15:30: getActivatedEnvironmentVariables [Error: StdErr from ShellExec, 'Analysis' is not recognized as an internal or external command, operable program or batch file. for C:/Users/bianc/miniconda3/Scripts/activate && conda activate itp_2020 && echo 'e8b39361-0157-4923-80e1-22d70d46dee6' && python c:\Users\bianc.vscode\extensions\ms-python.python-2020.6.90262\pythonFiles\pyvsc-run-isolated.py c:/Users/bianc/.vscode/extensions/ms-python.python-2020.6.90262/pythonFiles/printEnvVariables.py at E.getActivatedEnvironmentVariablesImpl (c:\Users\bianc.vscode\extensions\ms-python.python-2020.6.90262\out\client\extension.js:48:706808) at processTicksAndRejections (internal/process/task_queues.js:85:5)] t.log @ console.ts:137 $logExtensionHostMessage @ mainThreadConsole.ts:39 _doInvokeHandler @ rpcProtocol.ts:402 _invokeHandler @ rpcProtocol.ts:387 _receiveRequest @ rpcProtocol.ts:303 _receiveOneMessage @ rpcProtocol.ts:230 (anonymous) @ rpcProtocol.ts:105 fire @ event.ts:587 fire @ ipc.net.ts:453 _receiveMessage @ ipc.net.ts:733 (anonymous) @ ipc.net.ts:592 fire @ event.ts:587 acceptChunk @ ipc.net.ts:239 (anonymous) @ ipc.net.ts:200 t @ ipc.net.ts:28 emit @ events.js:203 addChunk @ _stream_readable.js:295 readableAddChunk @ _stream_readable.js:276 Readable.push @ _stream_readable.js:210 onStreamRead @ internal/stream_base_commons.js:166 console.ts:137 [Extension Host] Error Python Extension: 2020-06-28 00:15:30: getActivatedEnvironmentVariables, Class name = E, completed in 2269ms, has a falsy return value, Arg 1: undefined, Arg 2: {"architecture":3,"path":"C:\Users\bianc\miniconda3\envs\itp_2020\python.exe","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"3.6.10-final","major":3,"minor":6,"patch":10,"prerelease":["final"],"build":[],"version":"3.6.10-final"},"sysPrefix":"C:\Users\bianc\miniconda3\envs\itp_2020","fileHash":"ac2778943090fefbc43561e8fa5926bb61829a26bef4a1965cbb0bbf88f3a15cad4aa3fa32130b3cfb14cb8e4417c782f57f99ec5227803d50baf31c764eb310","companyDisplayName":"Anaconda, Inc.","type":"Conda","envPath":"C:\Users\bianc\miniconda3\envs\itp_2020","envName":"itp_2020","displayName":"Python 3.6.10 64-bit ('itp_2020': conda)"}, Arg 3: true [Error: StdErr from ShellExec, 'Analysis' is not recognized as an internal or external command, operable program or batch file. for C:/Users/bianc/miniconda3/Scripts/activate && conda activate itp_2020 && echo 'e8b39361-0157-4923-80e1-22d70d46dee6' && python c:\Users\bianc.vscode\extensions\ms-python.python-2020.6.90262\pythonFiles\pyvsc-run-isolated.py c:/Users/bianc/.vscode/extensions/ms-python.python-2020.6.90262/pythonFiles/printEnvVariables.py at E.getActivatedEnvironmentVariablesImpl (c:\Users\bianc.vscode\extensions\ms-python.python-2020.6.90262\out\client\extension.js:48:706808) at processTicksAndRejections (internal/process/task_queues.js:85:5)] t.log @ console.ts:137 $logExtensionHostMessage @ mainThreadConsole.ts:39 _doInvokeHandler @ rpcProtocol.ts:402 _invokeHandler @ rpcProtocol.ts:387 _receiveRequest @ rpcProtocol.ts:303 _receiveOneMessage @ rpcProtocol.ts:230 (anonymous) @ rpcProtocol.ts:105 fire @ event.ts:587 fire @ ipc.net.ts:453 _receiveMessage @ ipc.net.ts:733 (anonymous) @ ipc.net.ts:592 fire @ event.ts:587 acceptChunk @ ipc.net.ts:239 (anonymous) @ ipc.net.ts:200 t @ ipc.net.ts:28 emit @ events.js:203 addChunk @ _stream_readable.js:295 readableAddChunk @ _stream_readable.js:276 Readable.push @ _stream_readable.js:210 onStreamRead @ internal/stream_base_commons.js:166 console.ts:137 [Extension Host] Info Python Extension: 2020-06-28 00:15:30: Finished executing cell c12deb14-7a4e-4cec-a4bc-85ca689034c0 notificationsAlerts.ts:40 StdErr from ShellExec, 'Analysis' is not recognized as an internal or external command, operable program or batch file. for C:/Users/bianc/miniconda3/Scripts/activate && conda activate itp_2020 && echo 'e8b39361-0157-4923-80e1-22d70d46dee6' && python c:\Users\bianc.vscode\extensions\ms-python.python-2020.6.90262\pythonFiles\pyvsc-run-isolated.py c:/Users/bianc/.vscode/extensions/ms-python.python-2020.6.90262/pythonFiles/printEnvVariables.py onDidChangeNotification @ notificationsAlerts.ts:40 (anonymous) @ notificationsAlerts.ts:26 fire @ event.ts:587 addNotification @ notifications.ts:207 notify @ notificationService.ts:106 (anonymous) @ mainThreadMessageService.ts:83 _showMessage @ mainThreadMessageService.ts:44 $showMessage @ mainThreadMessageService.ts:38 _doInvokeHandler @ rpcProtocol.ts:402 _invokeHandler @ rpcProtocol.ts:387 _receiveRequest @ rpcProtocol.ts:303 _receiveOneMessage @ rpcProtocol.ts:230 (anonymous) @ rpcProtocol.ts:105 fire @ event.ts:587 fire @ ipc.net.ts:453 _receiveMessage @ ipc.net.ts:733 (anonymous) @ ipc.net.ts:592 fire @ event.ts:587 acceptChunk @ ipc.net.ts:239 (anonymous) @ ipc.net.ts:200 t @ ipc.net.ts:28 emit @ events.js:203 addChunk @ _stream_readable.js:295 readableAddChunk @ _stream_readable.js:276 Readable.push @ _stream_readable.js:210 onStreamRead @ internal/stream_base_commons.js:166 console.ts:137 [Extension Host] Error Python Extension: 2020-06-28 00:15:30: DataScience Error [Error: StdErr from ShellExec, 'Analysis' is not recognized as an internal or external command, operable program or batch file. for C:/Users/bianc/miniconda3/Scripts/activate && conda activate itp_2020 && echo 'e8b39361-0157-4923-80e1-22d70d46dee6' && python c:\Users\bianc.vscode\extensions\ms-python.python-2020.6.90262\pythonFiles\pyvsc-run-isolated.py c:/Users/bianc/.vscode/extensions/ms-python.python-2020.6.90262/pythonFiles/printEnvVariables.py at E.getActivatedEnvironmentVariablesImpl (c:\Users\bianc.vscode\extensions\ms-python.python-2020.6.90262\out\client\extension.js:48:706808) at processTicksAndRejections (internal/process/task_queues.js:85:5)] t.log @ console.ts:137 $logExtensionHostMessage @ mainThreadConsole.ts:39 _doInvokeHandler @ rpcProtocol.ts:402 _invokeHandler @ rpcProtocol.ts:387 _receiveRequest @ rpcProtocol.ts:303 _receiveOneMessage @ rpcProtocol.ts:230 (anonymous) @ rpcProtocol.ts:105 fire @ event.ts:587 fire @ ipc.net.ts:453 _receiveMessage @ ipc.net.ts:733 (anonymous) @ ipc.net.ts:592 fire @ event.ts:587 acceptChunk @ ipc.net.ts:239 (anonymous) @ ipc.net.ts:200 t @ ipc.net.ts:28 emit @ events.js:203 addChunk @ _stream_readable.js:295 readableAddChunk @ _stream_readable.js:276 Readable.push @ _stream_readable.js:210 onStreamRead @ internal/stream_base_commons.js:166 console.ts:137 [Extension Host] Error Python Extension: 2020-06-28 00:15:30: getActivatedEnvironmentVariables [Error: StdErr from ShellExec, 'Analysis' is not recognized as an internal or external command, operable program or batch file. for C:/Users/bianc/miniconda3/Scripts/activate && conda activate itp_2020 && echo 'e8b39361-0157-4923-80e1-22d70d46dee6' && python c:\Users\bianc.vscode\extensions\ms-python.python-2020.6.90262\pythonFiles\pyvsc-run-isolated.py c:/Users/bianc/.vscode/extensions/ms-python.python-2020.6.90262/pythonFiles/printEnvVariables.py at E.getActivatedEnvironmentVariablesImpl (c:\Users\bianc.vscode\extensions\ms-python.python-2020.6.90262\out\client\extension.js:48:706808) at processTicksAndRejections (internal/process/task_queues.js:85:5)] t.log @ console.ts:137 $logExtensionHostMessage @ mainThreadConsole.ts:39 _doInvokeHandler @ rpcProtocol.ts:402 _invokeHandler @ rpcProtocol.ts:387 _receiveRequest @ rpcProtocol.ts:303 _receiveOneMessage @ rpcProtocol.ts:230 (anonymous) @ rpcProtocol.ts:105 fire @ event.ts:587 fire @ ipc.net.ts:453 _receiveMessage @ ipc.net.ts:733 (anonymous) @ ipc.net.ts:592 fire @ event.ts:587 acceptChunk @ ipc.net.ts:239 (anonymous) @ ipc.net.ts:200 t @ ipc.net.ts:28 emit @ events.js:203 addChunk @ _stream_readable.js:295 readableAddChunk @ _stream_readable.js:276 Readable.push @ _stream_readable.js:210 onStreamRead @ internal/stream_base_commons.js:166 console.ts:137 [Extension Host] Error Python Extension: 2020-06-28 00:15:30: getActivatedEnvironmentVariables, Class name = E, completed in 2274ms, has a falsy return value, Arg 1: undefined, Arg 2: {"architecture":3,"path":"C:\Users\bianc\miniconda3\envs\itp_2020\python.exe","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"3.6.10-final","major":3,"minor":6,"patch":10,"prerelease":["final"],"build":[],"version":"3.6.10-final"},"sysPrefix":"C:\Users\bianc\miniconda3\envs\itp_2020","fileHash":"ac2778943090fefbc43561e8fa5926bb61829a26bef4a1965cbb0bbf88f3a15cad4aa3fa32130b3cfb14cb8e4417c782f57f99ec5227803d50baf31c764eb310","companyDisplayName":"Anaconda, Inc.","type":"Conda","envPath":"C:\Users\bianc\miniconda3\envs\itp_2020","envName":"itp_2020","displayName":"Python 3.6.10 64-bit ('itp_2020': conda)"}, Arg 3: true [Error: StdErr from ShellExec, 'Analysis' is not recognized as an internal or external command, operable program or batch file. for C:/Users/bianc/miniconda3/Scripts/activate && conda activate itp_2020 && echo 'e8b39361-0157-4923-80e1-22d70d46dee6' && python c:\Users\bianc.vscode\extensions\ms-python.python-2020.6.90262\pythonFiles\pyvsc-run-isolated.py c:/Users/bianc/.vscode/extensions/ms-python.python-2020.6.90262/pythonFiles/printEnvVariables.py at E.getActivatedEnvironmentVariablesImpl (c:\Users\bianc.vscode\extensions\ms-python.python-2020.6.90262\out\client\extension.js:48:706808) at processTicksAndRejections (internal/process/task_queues.js:85:5)]

Microsoft Data Science for VS Code Engineering Team: @rchiodo, @IanMatthewHuff, @DavidKutu, @DonJayamanne, @greazer, @joyceerhl

microsoft/vscode-python

Answer questions DavidKutu

You need to add VS Code to your path for code . to work. To do that you can follow these instructions:

  • Press the Windows logo on the task bar.
  • Type 'path'
  • Click on 'Edit the system environment variables'
  • On the bottom right, click Environment Variables
  • On the top section, where it says 'User variables for Your User' look for 'Path' and highlight it.
  • Press Edit
  • Add the path to the VS Code executable (it should be in C:\Program Files\Microsoft VS Code\bin or C:\Program Files (x86)\Microsoft VS Code\bin if you downloaded it to the default folder)
  • Click 'OK' to finish

Now close your current Anaconda Prompt and open a new one, code . should work.

useful!

Related questions

Auto Scroll in the Jupyter output hot 3
Workspace contains pipfile but pipenv --venv failed hot 2
Can you turn off the Microsoft Python Language Server? hot 2
Unable to debug Python tests (duplicate entries in &#34;env&#34;) hot 2
Jupyter server crashed. Unable to connect. Cannot assign requested address hot 2
Auto Scroll in the Jupyter output hot 2
Unable to run launch targets with newest VS Code Python extension hot 2
Unable to start jupyter python interactive window hot 1
HBox output is not shown correctly in the interactive window hot 1
Debug -> Add Debug Configuration 'Cannot read property openConfigFile' hot 1
VSCode cannot connect to jupyter server; with browser this works fine hot 1
Linux arm64/aarch64 support hot 1
Add setting to disable icon for "Run Python File In Terminal" hot 1
Extension Host keeps crashing hot 1
Activate environment before debugging tests hot 1
Github User Rank List