本文主要是介绍conda: error: argument COMMAND: invalid choice: ‘deactivate‘ / ‘activate‘,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
conda: error: argument COMMAND: invalid choice: 'deactivate' / 'activate'
- 1. conda: error: argument COMMAND: invalid choice: 'deactivate'
- 2. conda: error: argument COMMAND: invalid choice: 'activate'
- 3. source ~/miniconda3/etc/profile.d/conda.sh
- 4. source script_conda.sh
- 5. source deactivate
- References
1. conda: error: argument COMMAND: invalid choice: ‘deactivate’
(base) yongqiang@yongqiang:~/scripts$ chmod a+x script_conda.sh
(base) yongqiang@yongqiang:~/scripts$
(base) yongqiang@yongqiang:~/scripts$ cat script_conda.sh
#!/bin/bashconda env listconda deactivate(base) yongqiang@yongqiang:~/scripts$
(base) yongqiang@yongqiang:~/scripts$ ./script_conda.sh
# conda environments:
#
base * /home/yongqiang/miniconda3
py37 /home/yongqiang/miniconda3/envs/py37usage: conda [-h] [--no-plugins] [-V] COMMAND ...
conda: error: argument COMMAND: invalid choice: 'deactivate' (choose from 'clean', 'compare', 'config', 'create', 'info', 'init', 'install', 'list', 'notices', 'package', 'remove', 'uninstall', 'rename', 'run', 'search', 'update', 'upgrade', 'doctor', 'env', 'content-trust')
(base) yongqiang@yongqiang:~/scripts$
2. conda: error: argument COMMAND: invalid choice: ‘activate’
yongqiang@yongqiang:~/scripts$ chmod a+x script_conda.sh
yongqiang@yongqiang:~/scripts$
yongqiang@yongqiang:~/scripts$ cat script_conda.sh
#!/bin/bashconda activate baseyongqiang@yongqiang:~/scripts$
yongqiang@yongqiang:~/scripts$ ./script_conda.sh
usage: conda [-h] [--no-plugins] [-V] COMMAND ...
conda: 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', 'doctor', 'env', 'content-trust')
yongqiang@yongqiang:~/scripts$
3. source ~/miniconda3/etc/profile.d/conda.sh
You need to add the new source ~/miniconda3/etc/profile.d/conda.sh
line to your ~/.bashrc
file to ensure Anaconda Python can enabled in subsequent terminal sessions. conda activate base
and conda deactivate
will need to be run in each subsequent terminal session.
(base) yongqiang@yongqiang:~/scripts$ cat script_conda.sh
#!/bin/bashsource ~/miniconda3/etc/profile.d/conda.shconda env listconda deactivate(base) yongqiang@yongqiang:~/scripts$
(base) yongqiang@yongqiang:~/scripts$ ./script_conda.sh
# conda environments:
#
base * /home/yongqiang/miniconda3
py37 /home/yongqiang/miniconda3/envs/py37(base) yongqiang@yongqiang:~/scripts$
4. source script_conda.sh
(base) yongqiang@yongqiang:~/scripts$ cat script_conda.sh
#!/bin/bashconda env listconda deactivate(base) yongqiang@yongqiang:~/scripts$
(base) yongqiang@yongqiang:~/scripts$ source script_conda.sh
# conda environments:
#
base * /home/yongqiang/miniconda3
py37 /home/yongqiang/miniconda3/envs/py37yongqiang@yongqiang:~/scripts$
yongqiang@yongqiang:~/scripts$ cat script_conda.sh
#!/bin/bashconda activate baseyongqiang@yongqiang:~/scripts$
yongqiang@yongqiang:~/scripts$ source script_conda.sh
(base) yongqiang@yongqiang:~/scripts$
5. source deactivate
(base) yongqiang@yongqiang:~/scripts$ cat script_conda.sh
#!/bin/bashconda env listsource deactivate(base) yongqiang@yongqiang:~/scripts$
(base) yongqiang@yongqiang:~/scripts$ ./script_conda.sh
# conda environments:
#
base * /home/yongqiang/miniconda3
py37 /home/yongqiang/miniconda3/envs/py37DeprecationWarning: 'source deactivate' is deprecated. Use 'conda deactivate'.
(base) yongqiang@yongqiang:~/scripts$
References
[1] Yongqiang Cheng, https://yongqiang.blog.csdn.net/
[2] Installing via conda, https://docs.openforcefield.org/projects/toolkit/en/0.7.0/installation.html
这篇关于conda: error: argument COMMAND: invalid choice: ‘deactivate‘ / ‘activate‘的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!