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.

Conda activation does not work in Terminal

See original GitHub issue

Environment data

  • VS Code version: Stable/Insiders
  • Extension version (available under the Extensions sidebar): N/A
  • OS and version: Mac
  • Python version (& distribution if applicable, e.g. Anaconda): Anaconda 4.6
  • Type of virtual environment used (N/A | venv | virtualenv | conda | …): Conda
  • Relevant/affected Python packages and their versions: N/A

Expected behaviour

When a conda environment activated using conda activate xxx, then using python xxx will point to the activated environment.

Actual behaviour

Even though a conda environment has been activated, which python will point to the wrong environment.

Steps to reproduce:

  1. Open terminal (without python extenions)
  2. Run command conda activate xxx
  3. Run command which python

Tracked here https://github.com/microsoft/vscode-python/issues/5344 Upstream issue https://github.com/microsoft/vscode/issues/70248

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
siriusmaxcommented, Jul 27, 2019

checking off the ‘inherit Env’ in settings solved this issue on my mac

1reaction
luabudcommented, Sep 25, 2019

Prescribed solution

Cool, so if it isn’t a Windows machine and if the selected interpreter is a conda environment and “terminal.integrated.inheritEnv” is not set on the user’s user settings, we can prompt the message below:

“We noticed you’re using a conda environment. If you are experiencing issues with this environment in the integrated terminal, we suggest the “terminal.integrated.inheritEnv” setting to be changed to false. Would you like to update this setting?” Options: Yes, No

And add telemetry for the yes selection, so we can know if this is actually solving the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

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