/ bin / bash:conda:找不到命令

时间:2019-03-22 11:44:06

标签: conda google-colaboratory

!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!

1 个答案:

答案 0 :(得分:1)

Conda init

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

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

这应该生成一个 diff 输出,以及要检查的文件列表,并标有modifiedno change。如果建议的更改看起来不错,请继续运行而无需使用--dry-run

打开新Shell或获取更改后的任何文件(例如.bashrc)后,一切都应正常工作。


请勿编辑PATH(在Conda中为> 4.4)

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

相关问题