"Run Python File in Terminal" command fails due to using "conda run"
See original GitHub issueEnvironment data
Version: 1.41.1 (user setup) Commit: 26076a4de974ead31f97692a0d32f90d735645c0 Date: 2019-12-18T14:58:56.166Z Electron: 6.1.5 Chrome: 76.0.3809.146 Node.js: 12.4.0 V8: 7.6.303.31-electron.0 OS: Windows_NT x64 10.0.18363
I’m using Conda environments, conda version 4.8.0
Expected behaviour
When I invoke the “Run Python File in Terminal” command it should call “python.exe” in the activated environment.
Actual behaviour
The command uses the experimental feature “conda run --name=environment”. This feature doesn’t work yet on my machine. It always invokes the base environment rather than the selected project environment.
Steps to reproduce:
- create a new anaconda environment with a different python version from base environment
- select the new environment
- make sure all terminal sessions are closed
- run the following file: (resulting in creation of a new terminal window)
import sys
print(sys.version)
It will print the python version of the base environment.

Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (2 by maintainers)
Top Results From Across the Web
python - "ERROR conda.cli.main_run:execute(33)
go to vscode Extensions market and search "python". right click on "Python"(published by microsoft) and click on "Install another version".
Read more >Anaconda can't run Python script in command prompt
I just created a Python script, which is running fine in Spyder (I'm using Anaconda). When I try to run it now in...
Read more >Run stand-alone scripts—ArcGIS Pro | Documentation
When I launch the Python Command Prompt window, why do I get an access is denied error? You cannot use conda commands to...
Read more >Efficient Way to Activate Conda in VSCode - Medium
Option 2: Run “conda activate <env-name>” in terminal ... The second way is to have manual control of switching the conda environment in...
Read more >How can I run a python script using Anaconda from the ...
Create required Anaconda environment conda create --name environmentName python=3 pandas numpy . Include all your dependencies at once while ...
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
@giahung24 if you set
"extensions.autoUpdate": false
in your settings.json and rollback the python extension to 2019.10.44104 then it fixes the issue.I’m having the same issue on both conda 4.8.0 and 4.8.1.
With
script.py
asIt seems that running
conda run
in the activated environment is not running Python in the environment specified.Since VS Code activates the environment beforehand, then runs
conda run
when you click the run button, this causes the Python file to run in the wrong environment.