The "conda init" command is messing up my cmd startup in Win10
Asked Answered
J

2

3

What happened

I re-installed the anaconda on the good shinning day.

After installation, I run

conda init

to startup the conda environment.

Then, I found everything in my build is messed up. The cmd always complain about there are not supposed to be a "&" symbol. As a result, all the commands using the cmd is dead.

Finally, I find out the reason is the conda has changed the regedit key of

HKEY_CURRENT_USER\Software\Microsoft\Command Processor\AutoRun

into

if exist & if exist

It is definitely wrong. After delete the bug string. Everything is just fine.

My Mistake

I admit I was wrong to run the command, the correct command should be

conda init powershell

or

conda init cmd.exe

to install the anaconda environment in Win10.

My Question

My question is in two folders,

  1. Why the anaconda messes my regedit key like that?
  2. Why can't I reproduce the bug after that?

Can anyone help?

My Advice

If your cmd is broken too in the future, you can check the regedit for a quick debug.

Juniejunieta answered 1/4, 2021 at 8:47 Comment(1)
conda init --help says "shells One or more shells to be initialized. If not given, the default value is 'bash' on unix and 'cmd.exe' on Windows."Unclose
M
2

You should be able to fix this by running conda init --reverse in each shell.

In the event the AutoRun command sticks areound, you can remove it following the steps listed here: https://stackoverflow.com/a/59481892

Myungmyxedema answered 12/10, 2022 at 23:32 Comment(0)
B
1

The related code is here https://github.com/conda/conda/blob/6f76e4ccb38e23ffce079e63e2abcff051da9176/conda/core/initialize.py#L1414-L1473

But I don't know How it change AutoRun to if exist & if exist

Bitten answered 12/9, 2022 at 12:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.