question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

python.condaPath not considered when calling conda

See original GitHub issue

Environment 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]

  1. Set up Anaconda environment
  2. Make sure VS Code recognized environment (Python 3.xxx (‘name’: conda) in status bar)
  3. Make sure python.terminal.activateEnvironment is True
  4. Run a python file

Logs

Output for Python in the Output panel (ViewOutput, 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:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:14 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
QuaternionsRockcommented, Aug 9, 2021

I’m not sure if this was ever fixed, but I can confirm that it is still an issue.

1reaction
ericsnowcurrentlycommented, Jan 14, 2020

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).

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found