Repository navigation
Conda Issues #5344
Copy link
Copy link
Closed as not planned
Labels
area-environmentsFeatures relating to handling interpreter environmentsFeatures relating to handling interpreter environmentsbugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bugmetaIssue that is tracking an overall projectIssue that is tracking an overall projectneeds PRReady to be worked onReady to be worked on
Description
Use conda info
- Does
conda infowork on a vanilla install of Conda Spike - Can we useconda listandconda infoall the info we need to work with conda #6882
Use conda activate
- inheritEnv: Add prompt to flip "inheritEnv" setting to false to fix conda activation issue #7607
- Activate Environments using Paths (not env names) Activate conda environments using the path instead of the conda env name #3834
- Using env paths always works (suggestion from Conda team)
- Decide if we're going to support conda versions older than 4.6 (i.e. stop calling source); only support conda 4.6 and newer
- Only use
conda activateto activate conda environments (i.e. no more calls tosource) Spike - Use only conda activate, stop calling source #8864 - Depending on the above item, fix activation failures with Fish Shell Python: Create Terminal error command noise included when default shell is fish #4959
Use conda run
- changes in
PythonExecutionFactoryandPythonExecutionServicefix the following (Update PythonExecutionService to support "conda run". #7696):- formatting
- linting
- testing (partial)
- installers (partial)
- debugger (partial)
- interpreter discovery (partial)
- import sorting (partial)
- jedi
- refactoring
- (datascience?)
- currently do
exec()(Stop using "exec()" in the extension. #7697):- testing (partial)
-
installers (partial): In one case we usesudoand inpoetrycase we use path to binary directly. So this could not be addressed directly. -
debugger (partial): python debug adapter uses adapter descriptor. So no changes were made -
interpreter discovery (partial): Discussed with Don and should not be switched to python execution factory. - import sorting (partial)
- code execution / terminal
- (datascience?)
- ensure that (at this point) the extension only uses
PythonExecutionFactoryfor running python - Use conda run when debugging user code Use 'conda run' when debugging user code #8422
- verify it fixes Jupyter doesn't work with anaconda #5539, Environment gets activated after debugger starts (hence debugging with conda envs fail) #5559, debug test is hanging #3869
- make sure we're not explicitly doing activation for conda or any virtual environment executions (i.e. only activate as a side effect of creating a new terminal; Debugging fails when using a pipenv environment that gets activated with
pipenv shell#4203 )
Verifying conda work is done
Basically we are no longer doing any shenanigans behind conda's back to support it and we are using the provided tooling as expected.
- Use some
condacommand to get the list of environments - Only use
conda activateto activate environments (i.e. don't usesource) -
conda run- For executing tools (e.g. formatters, linters, and test runners)
- For executing user files (e.g. the green play button)
- For running the debugger
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area-environmentsFeatures relating to handling interpreter environmentsFeatures relating to handling interpreter environmentsbugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bugmetaIssue that is tracking an overall projectIssue that is tracking an overall projectneeds PRReady to be worked onReady to be worked on
Activity
DonJayamanne commentedon Apr 17, 2019
Suggestions/Notes:
No support for conda version < 4.6Leave as is for now. Current approach is a best approach.
conda)Conda notes on activation:
conda create
Create a new conda environment from a list of specified packages. To use the created environment, use 'source activate envname' look in that directory first. This command requires either the -n NAME or -p PREFIX option.conda activate $ENVNAME
Instructions can be found here (applies to >= 4.6)
activation & paths
Conda commands used to switch or move between installed environments. The conda activate command prepends the path of your current environment to the PATH environment variable so that you do not need to type it each time. deactivate removes it. Even when an environment is deactivated, you can still execute programs in that environment by specifying their paths directly, as in ~/anaconda/envs/envname/bin/program_name. When an environment is activated, you can execute the program in that environment with just program_name.Conda will never work in VSC
~/.bash_profileDonJayamanne commentedon Apr 29, 2019
TODO
** Conda Requirements**
~/.bash_profileare not idempotent conda/conda#8703./bash_profile& other platforms~/.bash_profileare not idempotent conda/conda#8703actiavte base env, thenactivate specific env53 remaining items
karrtikr commentedon May 25, 2023
Closing as stale.