我下载并安装了miniconda。
首先,可执行文件的名称不是conda
,而是_conda
。
无论如何,我键入:
_conda create -n test python=3.8.3
我继续并安装软件包。
然后我尝试用_conda activate test
激活环境
我明白了:
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>
Currently supported shells are:
- bash
- cmd.exe
- fish
- tcsh
- xonsh
- zsh
- powershell
See 'conda init --help' for more information and options.
IMPORTANT: You may need to close and restart your shell after running 'conda init'.
所以我键入_conda init cmd.exe
这就是我得到的:
WARNING: Cannot install xonsh wrapper without a python interpreter in prefix: C:
\Users\User1\AppData\Local\Temp\_MEI50762
needs sudo C:\Users\User1\AppData\Local\Temp\_MEI50762\Scripts\conda.exe
needs sudo C:\Users\User1\AppData\Local\Temp\_MEI50762\Scripts\conda-env.exe
modified C:\Users\User1\AppData\Local\Temp\_MEI50762\Scripts\conda-script.py
modified C:\Users\User1\AppData\Local\Temp\_MEI50762\Scripts\conda-env-script.py
needs sudo C:\Users\User1\AppData\Local\Temp\_MEI50762\condabin\conda.bat
needs sudo C:\Users\User1\AppData\Local\Temp\_MEI50762\Library\bin\conda.bat
needs sudo C:\Users\User1\AppData\Local\Temp\_MEI50762\condabin\_conda_activate.bat
needs sudo C:\Users\User1\AppData\Local\Temp\_MEI50762\condabin\rename_tmp.bat
needs sudo C:\Users\User1\AppData\Local\Temp\_MEI50762\condabin\conda_auto_activate.bat
needs sudo C:\Users\User1\AppData\Local\Temp\_MEI50762\condabin\conda_hook.bat
needs sudo C:\Users\User1\AppData\Local\Temp\_MEI50762\Scripts\activate.bat
needs sudo C:\Users\User1\AppData\Local\Temp\_MEI50762\condabin\activate.bat
needs sudo C:\Users\User1\AppData\Local\Temp\_MEI50762\condabin\deactivate.bat
needs sudo C:\Users\User1\AppData\Local\Temp\_MEI50762\Scripts\activate
needs sudo C:\Users\User1\AppData\Local\Temp\_MEI50762\Scripts\deactivate
needs sudo C:\Users\User1\AppData\Local\Temp\_MEI50762\etc\profile.d\conda.sh
needs sudo C:\Users\User1\AppData\Local\Temp\_MEI50762\etc\fish\conf.d\conda.fish
needs sudo C:\Users\User1\AppData\Local\Temp\_MEI50762\shell\condabin\Conda.psm1
needs sudo C:\Users\User1\AppData\Local\Temp\_MEI50762\shell\condabin\conda-hook.ps1
needs sudo C:\Users\User1\AppData\Local\Temp\_MEI50762\etc\profile.d\conda.csh
modified HKEY_CURRENT_USER\Software\Microsoft\Command Processor\AutoRun
==> For changes to take effect, close and re-open your current shell. <==
Operation failed.
我也尝试过_conda init powershell
和_conda init bash
,但都失败了。
答案 0 :(得分:1)
我遇到了同样的问题。使用 conda.bat
中的 <anaconda_install_dir>\condabin
文件而不是根 _conda.exe
。
然后您应该可以运行 conda activate test
(如果您将 <anaconda_install_dir>\condabin
添加到 PATH
)。