gpt4 book ai didi

python - Conda 不会让我激活环境

转载 作者:行者123 更新时间:2023-12-04 15:20:07 25 4
gpt4 key购买 nike

我下载并安装了 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 ,他们都失败了。

最佳答案

我有同样的问题。使用 conda.bat <anaconda_install_dir>\condabin 内的文件而不是根 _conda.exe .
然后你应该可以运行 conda activate test (如果您将 <anaconda_install_dir>\condabin 添加到 PATH )。

关于python - Conda 不会让我激活环境,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63508641/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com