/ bin / bash:找不到conda:command

问题描述 投票:1回答:1
!conda --version
/bin/bash: conda: command not found

我已经安装了miniconda并选择自动添加环境变量,但我仍然无法使用它们。我正在使用Google Colab。

WARNING:
You currently have a PYTHONPATH environment variable set. This may cause
unexpected behavior when running the Python interpreter in Miniconda3.
For best results, please verify that your PYTHONPATH only points to
directories of packages that are compatible with the Python interpreter
in Miniconda3: /root/miniconda3

Do you wish the installer to initialize Miniconda3
in your /root/.bashrc ? [yes|no]
[no] >>> yes

Initializing Miniconda3 in /root/.bashrc
A backup will be made to: /root/.bashrc-miniconda3.bak


For this change to become active, you have to open a new terminal.

Thank you for installing Miniconda3!
conda google-colaboratory
1个回答
1
投票

Conda init

尝试手动运行Conda的初始化方法。首先检查它会做什么:

/root/miniconda3/bin/conda init --dry-run -vv

这应该生成一个diff输出,加上它正在检查的文件列表,用modifiedno change标记。如果建议的更改看起来不错,那么继续运行它而不使用--dry-run

一旦你打开一个新的shell,或者找到它改变的任何文件(例如,.bashrc),事情应该正常工作。


Don't Edit PATH (in Conda >=4.4)

请注意,此建议适用于最新版本的Conda(v4.4 +,AFAIK)。对于旧版本,过去建议直接将bin目录添加到PATH,但现在不建议这样做(请参阅Conda v4.4 Release Notes)。

© www.soinside.com 2019 - 2024. All rights reserved.