conda - /bin/bash: conda: 找不到命令
问题描述
!conda --version
/bin/bash: conda: command not found
我已经安装了 miniconda 并选择了自动添加环境变量,但我仍然无法使用它们。我正在使用谷歌 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!
解决方案
康达init
尝试手动运行 Conda 的初始化方法。首先检查它会做什么:
/root/miniconda3/bin/conda init --dry-run -vv
这应该生成一个diff输出,以及它正在检查的文件列表,用modified
或标记no change
。如果建议的更改看起来不错,那么继续运行它而不使用--dry-run
.
一旦你打开一个新的 shell,或者源它改变的任何文件(例如,),事情应该会正常工作.bashrc
。
不要编辑PATH
(在 Conda >=4.4 中)
请注意,此建议适用于最新版本的 Conda(v4.4+,AFAIK)。对于旧版本,过去建议直接将bin
目录添加到PATH
,但现在不鼓励这样做(请参阅Conda v4.4 发行说明)。
推荐阅读
- php - 如何在 PHP 中强制下载 .xlsx 文件而不使其损坏?
- micronaut - 如何将 HTTP 客户端库写入 Micronaut 服务?
- sql - 如何将 Sysdate 转换为 Int?
- sql-server - 使用 dtsx 包运行功能导入 .mdb 文件 从 SQL Server 转换为 PostgreSQL
- excel - 有没有办法用范围单元格进行 VLOOKUP 包含在单元格值中
- javascript - saveToCameraRoll 不是函数
- python - 在为其他装饰器(例如夹具、模拟)传递参数时如何正确使用 pytest mark.parametrize 装饰器?
- javascript - 如何修复 Windows 终端中的“查找”命令
- r - 使用“dplyr”计算高效汉明距离
- c# - 如何向字典中已由查询填充的第一个选项添加值?