How to init shell for conda on Win 10?
Asked Answered
N

6

9

When I run conda init cmd.exe in either normal or admin mode I get the following error.

WARNING: Cannot install xonsh wrapper without a python interpreter in prefix: C:\Users\JASONL~1\AppData\Local\Temp\_MEI202282
needs sudo    C:\Users\JASONL~1\AppData\Local\Temp\_MEI202282\Scripts\conda.exe
needs sudo    C:\Users\JASONL~1\AppData\Local\Temp\_MEI202282\Scripts\conda-env.exe
modified      C:\Users\JASONL~1\AppData\Local\Temp\_MEI202282\Scripts\conda-script.py
modified      C:\Users\JASONL~1\AppData\Local\Temp\_MEI202282\Scripts\conda-env-script.py
needs sudo    C:\Users\JASONL~1\AppData\Local\Temp\_MEI202282\condabin\conda.bat
needs sudo    C:\Users\JASONL~1\AppData\Local\Temp\_MEI202282\Library\bin\conda.bat
needs sudo    C:\Users\JASONL~1\AppData\Local\Temp\_MEI202282\condabin\_conda_activate.bat
needs sudo    C:\Users\JASONL~1\AppData\Local\Temp\_MEI202282\condabin\rename_tmp.bat
needs sudo    C:\Users\JASONL~1\AppData\Local\Temp\_MEI202282\condabin\conda_auto_activate.bat
needs sudo    C:\Users\JASONL~1\AppData\Local\Temp\_MEI202282\condabin\conda_hook.bat
needs sudo    C:\Users\JASONL~1\AppData\Local\Temp\_MEI202282\Scripts\activate.bat
needs sudo    C:\Users\JASONL~1\AppData\Local\Temp\_MEI202282\condabin\activate.bat
needs sudo    C:\Users\JASONL~1\AppData\Local\Temp\_MEI202282\condabin\deactivate.bat
needs sudo    C:\Users\JASONL~1\AppData\Local\Temp\_MEI202282\Scripts\activate
needs sudo    C:\Users\JASONL~1\AppData\Local\Temp\_MEI202282\Scripts\deactivate
needs sudo    C:\Users\JASONL~1\AppData\Local\Temp\_MEI202282\etc\profile.d\conda.sh
needs sudo    C:\Users\JASONL~1\AppData\Local\Temp\_MEI202282\etc\fish\conf.d\conda.fish
needs sudo    C:\Users\JASONL~1\AppData\Local\Temp\_MEI202282\shell\condabin\Conda.psm1
needs sudo    C:\Users\JASONL~1\AppData\Local\Temp\_MEI202282\shell\condabin\conda-hook.ps1
needs sudo    C:\Users\JASONL~1\AppData\Local\Temp\_MEI202282\etc\profile.d\conda.csh
modified      HKEY_CURRENT_USER\Software\Microsoft\Command Processor\AutoRun

What does this mean and how do I fix it? Should I just try a fresh install?

Nodarse answered 17/6, 2020 at 16:58 Comment(0)
L
8

I had the same problem.

Running %conda_root_directory%/Library/bin/conda.bat init cmd.exe did the trick. Then I restarted the shell (cmd) and I was able to activate my environment and install a package.

Leptophyllous answered 18/8, 2022 at 9:43 Comment(0)
N
5

Use the anaconda prompt instead of cmd.exe to run the commands.

Nodarse answered 18/6, 2020 at 0:59 Comment(0)
M
1

Run the command in Anaconda PowerShell Prompt.(Start Menu -> Anaconda3 -> Anaconda PowerShell Prompt)

Mayotte answered 18/4, 2021 at 3:59 Comment(0)
M
1

Windows 11 & Miniconda

I had this very error. It came up when I tried to activate an environment I'd just created.

I know the cause on my end was newbie mistakes, but maybe there's a newbie out here who also made the same mistake.

I wanted to run conda from cmd and not the shell that comes with miniconda. I had added C:\Users\vic\miniconda3\ to environment variables. conda was not recognized when I tried conda --version.

I went to the miniconda installed directory and renamed the _conda.exe to conda.exe. Some conda functionalities worked after doing this: conda create, conda info, conda config

Whenever I tried to use the new environment with conda activate newenv, it'd tell me to do conda init first. And this then gave the very error message on this question.

That path on the error doesn't exist.

I watched a video on YT that helped me fix it. I renamed the conda.exe back to _conda.exe and added the condabin path to environment variables. Should look something like this: C:\Users\vic\miniconda3\condabin

And that solved the issue. I can use the new environment I'd created.

I know this is very verbose, but I hope it helps someone making the same rookie mistakes I did.

Mastic answered 5/9, 2024 at 8:32 Comment(0)
N
0

I had the same error. Reinstalling Anaconda fixed the issue (Conda 4.10.1).

Nealneala answered 5/7, 2021 at 8:5 Comment(0)
S
0

I met this issue too when using miniconda. I tried this :%conda_root_directory%/Library/bin/conda.bat init and it worked.

Strum answered 17/4, 2024 at 8:19 Comment(1)
Sorry I've tried again and this worked this time. I wonder if this problem happens when I use another disk to install conda instead of C:Strum

© 2022 - 2025 — McMap. All rights reserved.