Python terminal not activating anaconda prompt
See original GitHub issueEnvironment data:
- VS Code version: 1.56
- Extension version (available under the Extensions sidebar): v2021.4.765268190
- OS and version: Windows 10 Pro 10.0.19041
- Python version (& distribution if applicable, e.g. Anaconda): Python 3.8.8, Anaconda 4.9.2
- Type of virtual environment used (N/A | venv | virtualenv | conda | …): conda
- Value of the
python.languageServersetting: Pylance
Expected behaviour
Before version 1.56 of vscode when I ran the Run python file in terminal command, the command prompt was opened, then turned into anaconda prompt by running activate.bat, then the environment of the selected python interpreter was activated and finally the script was executed.
Actual behaviour
Opens the command prompt, tries to activate the conda environment without having first activated the anaconda prompt, the command fails, then tries to execute the python file (the command has a & at the beginning) which also fails.
Steps to reproduce:
Just by executing the Run Python File in Terminal command in the command palette after updating vscode to 1.56 before update everything was working fine.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:11 (1 by maintainers)
Top Results From Across the Web
Visual Studio Code terminal doesn't activate Conda environment
First, open the Anaconda prompt (How to access Anaconda command prompt in Windows 10 (64-bit)), and type: conda activate tom. To activate your...
Read more >conda environment activation not working in Python Terminal
Try this: Anaconda prompt and cd to your workspace. Activate the environment using conda activate; Start VS Code using code .
Read more >terminal not activating the conda environment : PY-23417
When I open the Pycharm terminal window in a project that uses Anaconda, the Windows command prompt is display in the project directory...
Read more >Getting started with conda
Conda is a powerful package manager and environment manager that you use with command line commands at the Anaconda Prompt for Windows, or...
Read more >Getting started with Navigator - Anaconda Documentation
Or from the Start menu, search for “Anaconda Prompt” and click to open. In Anaconda Prompt, type in anaconda-navigator and press Enter to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I was using anaconda powershell, now I tried on anaconda prompt and it worked, but when I use the run python file in terminal command, it tries to create a new integrated terminal instead of using the current activated one.
Should I open new issue for this?
Nope, that’s expected, as many users do not like us to disrupt their current terminal. It should still be using the activated conda environment.
Glad you got it to work.