Activating prefix conda environment does not work when in discovery experiment
See original GitHub issueEnvironment data
-
VS Code version: Version: 1.55.0 (user setup) Commit: c185983a683d14c396952dd432459097bc7f757f Date: 2021-03-30T16:01:55.261Z OS: Windows_NT x64 10.0.18363
-
Extension version (available under the Extensions sidebar): v2021.3.680753044
-
Python version (& distribution if applicable, e.g. Anaconda): 3.7.9 64bit - Anaconda
-
Type of virtual environment used (N/A | venv | virtualenv | conda | …): conda
Task
Load a conda environment, located at ./.venv
from the terminal.
Expected behaviour
Conda environment loaded properly after selecting the interpreter and open a new terminal.
Actual behaviour
Not loaded. The error message is as follows:
C:\Users\xxxxx\AppData\Local\Continuum\anaconda3\Scripts\activate .venv
Could not find conda environment: .venv
You can list all discoverable environments with `conda info --envs`.
It’s possible to activate conda’s base environment and run conda activate ./.venv
to activate the virtual environment, but that doesn’t help because when I highlight and run the code, it opens a new terminal then fails to load the virtual environment.
Steps to reproduce:
- Create a conda environment at
./.venv
:conda env create -f requirements.yml --prefix ./.venv
- Select the interpreter by
Ctrl + Shift + P
Python: Select interpreter
,- Select
\.venv\python.exe
- Open a new terminal
Logs
User belongs to experiment group 'pythonaa'
User belongs to experiment group 'pythonSendEntireLineToREPL'
User belongs to experiment group 'pythonNotDisplayLinterPrompt'
User belongs to experiment group 'pythonDiscoveryModuleWithoutWatcher'
User belongs to experiment group 'pythonTensorboardExperimentcf'
User belongs to experiment group 'pythonFindInterpretercf'
User belongs to experiment group 'PythonPyTorchProfiler'
User belongs to experiment group 'CollectLSRequestTiming - experiment'
User belongs to experiment group 'CollectNodeLSRequestTiming - experiment'
User belongs to experiment group 'DeprecatePythonPath - control'
Python interpreter path: .\.venv\python.exe
Starting Jedi Python language engine.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (1 by maintainers)
Yes, this is affecting all of the users doing Python development at my company. Thanks @xquyvu for the work-around!
I’ve managed to get it working by adding this in the
settings.json
.Before opting out:
After opting out:
Looks like an “experiment” is removing the path to the virtual environment which makes it cannot be found. The issue is going to be inevitable when this experiment goes live.
Please help address this.