Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inheritEnv false is needed for conda environments but true is needed for vscode-R #16301

Closed
JulioV opened this issue May 21, 2021 · 2 comments
Closed
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster

Comments

@JulioV
Copy link

JulioV commented May 21, 2021

Environment data

  • VS Code version: 1.56.2
  • Extension version (available under the Extensions sidebar): v2021.5.842923320
  • OS and version: 11.3.1 (20E241)
  • Python version (& distribution if applicable, e.g. Anaconda): 3.79
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): conda 4.8.4
  • Value of the python.languageServer setting: pylance

Apologies if this should be posted in https://github.com/microsoft/vscode or somewhere else. I do not fully understand the role of "terminal.integrated.inheritEnv"

The problem is that inheritEnv has to be False for me to be able to activate conda from the terminal (#5764). However, the vscode-R extension needs inheritEnv set to True so it can work with https://github.com/randy3k/radian (see REditorSupport/vscode-R#273).

The reason I am reporting this as a bug is that inheritEnv can be set to True and I can get my conda environment to work by running conda deactivate twice and then activating my conda environment. Maybe this points to a fix for this problem without disabling inheritEnv?

As expected from #5764, when inheritEnv is True and I try to activate my conda environment from the terminal the environment seems to be active (it appears at the start of my terminal prompt) but it is actually pointing to my machine's default Python binary (2.7 in Mac OS) instead of the Python binary in the environment.

@JulioV JulioV added triage-needed Needs assignment to the proper sub-team bug Issue identified by VS Code Team member as probable bug labels May 21, 2021
@karrtikr
Copy link

Can you try this?

  1. Anaconda prompt and cd to your workspace.
  2. Activate the environment using conda activate
  3. Start VS Code using code .

related #10626

@karrtikr karrtikr self-assigned this May 24, 2021
@karrtikr karrtikr added triage and removed triage-needed Needs assignment to the proper sub-team labels May 24, 2021
@JulioV JulioV changed the title inheritEnv false is needed for conda environments for true for vscode-R inheritEnv false is needed for conda environments but true is needed for vscode-R May 24, 2021
@karrtikr karrtikr added the info-needed Issue requires more information from poster label May 25, 2021
@karrtikr
Copy link

I think that should work, after which you can remove the inheritEnv: false setting. If it doesn't let us know and we'll reopen the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

2 participants