Skip to content

Failure to activate Conda Environments created using the --prefix argument (on Unix) #18044

Closed as not planned
@DonJayamanne

Description

@DonJayamanne
  • OS - Linux (I believe this should repro on Mac as well)
  • Python - Anaconda
  • Python version - 3.9

Steps to repro

  • Create a conda environment using the cli conda create -p .condaEnv1
  • Re-load VS Code and select this as the interpreter
  • Create a terminal
  • The terminal fails to activate

I believe the code will only work on Windows.

Suggestion

  • Leave the code as is for windows
  • For Unix the actiavte code can be:
    • Activate one of the other environments such as base (environments with a name)
    • Then activate the current envioronment

What I'm doing in my private extension is:

  • Generate activate scripts for a named environment (remove the second set of commands)
  • Hard code conda activate -n <path>

I believe this will work.

Problems

  • To get this working, we need a list of the conda envioronments when generating the activation code for a specific environment.
    • I can do this in my private extension thats super easy, i have all interperters & the code is super simple
    • WIth Python extension the way it works is we don't know about all of the conda envionrments

Hence not really sure how to proceed with this.
@karrtikr @karthiknadig Let me know if you're happy with me just fetching all of the conda environments & then trying that approach.
At the end of the day, thats better than what we have today, as I don't see how it will work (i.e. its better than nothing).

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions