'Error while configuring conda activate on powershell using "conda init"

I tried to use the command conda activate
It threw me an error:

CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
If using 'conda activate' from a batch script, change your
invocation to 'CALL conda.bat activate'.

To initialize your shell, run

    $ conda init <SHELL_NAME>

So I tried conda init powershell. which threw me another error:
Note: I have tried this running in Administrator mode also.

PS C:\Users\Ashin> conda init powershell
WARNING: Cannot install xonsh wrapper without a python interpreter in prefix: C:\Users\Ashin\AppData\Local\Temp\_MEI195762
needs sudo    C:\Users\Ashin\AppData\Local\Temp\_MEI195762\Scripts\conda.exe
needs sudo    C:\Users\Ashin\AppData\Local\Temp\_MEI195762\Scripts\conda-env.exe
modified      C:\Users\Ashin\AppData\Local\Temp\_MEI195762\Scripts\conda-script.py
modified      C:\Users\Ashin\AppData\Local\Temp\_MEI195762\Scripts\conda-env-script.py
needs sudo    C:\Users\Ashin\AppData\Local\Temp\_MEI195762\condabin\conda.bat
needs sudo    C:\Users\Ashin\AppData\Local\Temp\_MEI195762\Library\bin\conda.bat
needs sudo    C:\Users\Ashin\AppData\Local\Temp\_MEI195762\condabin\_conda_activate.bat
needs sudo    C:\Users\Ashin\AppData\Local\Temp\_MEI195762\condabin\rename_tmp.bat
needs sudo    C:\Users\Ashin\AppData\Local\Temp\_MEI195762\condabin\conda_auto_activate.bat
needs sudo    C:\Users\Ashin\AppData\Local\Temp\_MEI195762\condabin\conda_hook.bat
needs sudo    C:\Users\Ashin\AppData\Local\Temp\_MEI195762\Scripts\activate.bat
needs sudo    C:\Users\Ashin\AppData\Local\Temp\_MEI195762\condabin\activate.bat
needs sudo    C:\Users\Ashin\AppData\Local\Temp\_MEI195762\condabin\deactivate.bat
needs sudo    C:\Users\Ashin\AppData\Local\Temp\_MEI195762\Scripts\activate
needs sudo    C:\Users\Ashin\AppData\Local\Temp\_MEI195762\Scripts\deactivate
needs sudo    C:\Users\Ashin\AppData\Local\Temp\_MEI195762\etc\profile.d\conda.sh
needs sudo    C:\Users\Ashin\AppData\Local\Temp\_MEI195762\etc\fish\conf.d\conda.fish
needs sudo    C:\Users\Ashin\AppData\Local\Temp\_MEI195762\shell\condabin\Conda.psm1
needs sudo    C:\Users\Ashin\AppData\Local\Temp\_MEI195762\shell\condabin\conda-hook.ps1
needs sudo    C:\Users\Ashin\AppData\Local\Temp\_MEI195762\etc\profile.d\conda.csh
modified      C:\Users\Ashin\Documents\WindowsPowerShell\profile.ps1

==> For changes to take effect, close and re-open your current shell. <==

Operation failed.

Please help me to resolve this. Thanks in advance



Solution 1:[1]

I had the same issue and resolved by using conda init powershell from the anaconda prompt packaged with miniconda.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Alessandro Romancino