ubuntu安装anaconda后出现“conda: command not found”

1. 使用conda 命令时出现“conda: command not found”

原因:

~/.bashrc文件没有配置好

解决方案:

vim ~/.bashrc

在最后一行加上

export PATH=$PATH:/home/wzg/anaconda3/bin

把上面的“/home/wzg/anaconda3/bin”换成自己的anaconda的安装目录即可。

然后保存更改,运行

source ~/.bashrc

参考:

https://blog.csdn.net/weixin_38705903/article/details/86533863

2. 使用命令conda activate XXXX 环境时出现以下报错:

usage: conda-script.py [-h] [–no-plugins] [-V] COMMAND …
conda-script.py: error: argument COMMAND: invalid choice: ‘activate’ (choose from ‘clean’, ‘compare’, ‘config’, ‘create’, ‘info’, ‘init’, ‘install’, ‘list’, ‘notices’, ‘package’, ‘remove’, ‘uninstall’, ‘rename’, ‘run’, ‘search’, ‘update’, ‘upgrade’, ‘build’, ‘convert’, ‘debug’, ‘develop’, ‘doctor’, ‘index’, ‘inspect’, ‘metapackage’, ‘render’, ‘skeleton’, ‘token’, ‘repo’, ‘server’, ‘pack’, ‘env’, ‘verify’, ‘content-trust’)

解决方法Powershell管理员输入  conda init

conda init

或

conda init bash

你可能感兴趣的:(ubuntu,conda,linux)