Skip to content

How can I create a PowerShell console with conda base environment activated? #2313

@haocheng6

Description

@haocheng6

Purpose of the issue

  • Bug report (encountered problems/errors)
  • Feature request (request for new functionality)
  • Question

Version Information

Cmder: 1.3.13.967
ConEmu: 191012 preview
Windows 10

Description of the issue

I want to create a task to open a new PowerShell console with the base conda environment activated. I am not familiar with PowerShell script syntax and I couldn't find relevant issues. I tried some; for example, I added the following commands to the end of user_profile.ps1

C:\ProgramData\Anaconda3\shell\condabin\conda-hook.ps1
conda activate C:\ProgramData\Anaconda3

but this would make the prompt become "(base) PS D:\Software\cmder>" and it's colorless. Other part of the console is fine and correctly colored. I want the color of the prompt back and I want to remove the redundant "PS". What should I do?

Also, in this way, all newly-created PowerShell consoles will have conda activated since I modified user_profile.ps1. How can I let only one task to activate conda while other tasks remain intact. Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    👀 Awaiting ResponseWaiting to hear back from the issue reporter.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions