python.condaPath not considered when calling conda
See original GitHub issueEnvironment data
- VS Code version: 1.41.0
- Extension version (available under the Extensions sidebar): 2019.11.50794
- OS and version: Windows 10
- Python version (& distribution if applicable, e.g. Anaconda): Anaconda 3 (Python 3.6)
- Type of virtual environment used (N/A | venv | virtualenv | conda | …): conda
- Relevant/affected Python packages and their versions: XXX
- Jedi or Language Server? (i.e. what is
"python.jediEnabled"
set to; more info #3977): Jedi
Expected behaviour
When setting python.condaPath
to the conda executable, e.g. C:/Programs/anaconda/Scripts/conda.exe
, the activate command should be used with this executable if a python file is run.
Actual behaviour
conda
command is run instead. Since conda
is not in my PATH, I get an error that the command is not recognized.
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
PS C:\Path\Stuff> conda activate test
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.
Steps to reproduce:
[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]
- Set up Anaconda environment
- Make sure VS Code recognized environment (Python 3.xxx (‘name’: conda) in status bar)
- Make sure
python.terminal.activateEnvironment
is True - Run a python file
Logs
Output for Python
in the Output
panel (View
→Output
, change the drop-down the upper-right of the Output
panel to Python
)
XXX
Output from Console
under the Developer Tools
panel (toggle Developer Tools on under Help
; turn on source maps to make any tracebacks be useful by running Enable source map support for extension debugging
)
XXX
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:14 (5 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 >Efficient Way to Activate Conda in VSCode - Medium
Note: You need to first setup Python.condaPath to be able to use conda command like this. See the previous section Option 2. (3)...
Read more >Working with Environments – Introduction to Conda for (Data ...
Conda has a default environment called base that include a Python installation and some core system libraries and dependencies of Conda.
Read more >Settings Reference for Python - Visual Studio Code
General Python settings. Setting (python.) Default, Description. condaPath, "conda", Path to the ...
Read more >Python Installation - Conda Install | Google Earth Engine
Since Miniconda has not been added to your system's PATH environment variable, you will first need to activate conda for this session by...
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’m not sure if this was ever fixed, but I can confirm that it is still an issue.
Thanks for the update, @sbmueller. This is a known problem with our use of conda. One way or another we will be fixing it. Unfortunately I don’t have a good estimate on when that will be. We’ll keep you posted on developments.
Also, I’m pretty sure that this is a duplicate of an existing issue. However, with the churn over the last few days I don’t want this to slip through the cracks, so I’m keeping your issue open. If we find there is another issue open for the same problem (after things settle down) then we’ll probably close this issue at that time (and you can follow the other one).