Skip to content

Conda environments except 'base' not activated on windows 10 in integrated terminal using cmd.exe #6576

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

Closed
phloose opened this issue Jul 14, 2019 · 2 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug

Comments

@phloose
Copy link

phloose commented Jul 14, 2019

Environment data

  • VS Code version: 1.36.1 (system setup)
  • Extension version: 2019.6.24221
  • OS and version: Windows 10 1809
  • Python version : python3 (differs depending on used env) Miniconda3
  • Type of virtual environment used: conda 4.7.5
  • Jedi or Language Server? : Language server
  • Integrated terminal: cmd.exe

Expected behaviour

If python interpreter is set to env-xy (bottom left of statusbar) the respective environment should be activated in the integrated terminal when

  • opening new terminal with the plus sign
  • running a file in terminal (right click -> run python-file in terminal)
  • opening a REPL

Actual behaviour

If environment env-xy is selected and one of the actions mentioned in the bulletpoints is run the respective environment is not activated. It just uses the base environment, regardless of settings made in settings.json. Only the python interactive window is run in env-xy. If you switch back from there to base and open a new terminal activate.bat is run. For other environments this does not happen.

A workaround for now is to activate the environment from the anaconda prompt and then launch vscode from the anaconda prompt.

I remember that switching environments worked before, but unfortunatly i cannot say which update (vscode, python-ext or conda) broke this.

Steps to reproduce:

  • Create a new environment conda create -n env-xy python=3.7 with anaconda prompt
  • Select python interpreter/conda environment 'env-xy' (bottom left of statusbar)
  • run one of the three following actions:
    • open new terminal with the plus sign
    • run a python file (right click -> run python-file in terminal)
    • open a REPL
@phloose phloose added triage-needed Needs assignment to the proper sub-team bug Issue identified by VS Code Team member as probable bug labels Jul 14, 2019
@phloose
Copy link
Author

phloose commented Jul 14, 2019

Ok i just found out that i have to explicitly set

"python.condaPath": "C:\\Users\\xibalba01\\Miniconda3\\Library\\bin\\conda.bat"

Then it works as expected. But i remember that setting this path explicitly was not needed before. Also the initial terminal when opening vscode does not automatically get activated in the chosen environment.

Maybe this helps anybody who encountered the same problem for now.

@ghost ghost removed the triage-needed Needs assignment to the proper sub-team label Jul 15, 2019
@DonJayamanne
Copy link

lso the initial terminal when opening vscode does not automatically get activated in the chosen environment.

Dup of #5330

@ghost ghost removed the triage label Jul 18, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jul 25, 2019
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
Projects
None yet
Development

No branches or pull requests

3 participants