conda: error: argument COMMAND: invalid choice: ‘deactivate‘ / ‘activate‘

2023-12-21 21:30

本文主要是介绍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‘的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/521555

相关文章

mysql出现ERROR 2003 (HY000): Can‘t connect to MySQL server on ‘localhost‘ (10061)的解决方法

《mysql出现ERROR2003(HY000):Can‘tconnecttoMySQLserveron‘localhost‘(10061)的解决方法》本文主要介绍了mysql出现... 目录前言:第一步:第二步:第三步:总结:前言:当你想通过命令窗口想打开mysql时候发现提http://www.cpp

springboot报错Invalid bound statement (not found)的解决

《springboot报错Invalidboundstatement(notfound)的解决》本文主要介绍了springboot报错Invalidboundstatement(not... 目录一. 问题描述二.解决问题三. 添加配置项 四.其他的解决方案4.1 Mapper 接口与 XML 文件不匹配

Linux修改pip和conda缓存路径的几种方法

《Linux修改pip和conda缓存路径的几种方法》在Python生态中,pip和conda是两种常见的软件包管理工具,它们在安装、更新和卸载软件包时都会使用缓存来提高效率,适当地修改它们的缓存路径... 目录一、pip 和 conda 的缓存机制1. pip 的缓存机制默认缓存路径2. conda 的缓

Python中conda虚拟环境创建及使用小结

《Python中conda虚拟环境创建及使用小结》本文主要介绍了Python中conda虚拟环境创建及使用小结,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们... 目录0.前言1.Miniconda安装2.conda本地基本操作3.创建conda虚拟环境4.激活c

python管理工具之conda安装部署及使用详解

《python管理工具之conda安装部署及使用详解》这篇文章详细介绍了如何安装和使用conda来管理Python环境,它涵盖了从安装部署、镜像源配置到具体的conda使用方法,包括创建、激活、安装包... 目录pytpshheraerUhon管理工具:conda部署+使用一、安装部署1、 下载2、 安装3

解决systemctl reload nginx重启Nginx服务报错:Job for nginx.service invalid问题

《解决systemctlreloadnginx重启Nginx服务报错:Jobfornginx.serviceinvalid问题》文章描述了通过`systemctlstatusnginx.se... 目录systemctl reload nginx重启Nginx服务报错:Job for nginx.javas

jenkins 插件执行shell命令时,提示“Command not found”处理方法

首先提示找不到“Command not found,可能我们第一反应是查看目标机器是否已支持该命令,不过如果相信能找到这里来的朋友估计遇到的跟我一样,其实目标机器是没有问题的通过一些远程工具执行shell命令是可以执行。奇怪的就是通过jenkinsSSH插件无法执行,经一番折腾各种搜索发现是jenkins没有加载/etc/profile导致。 【解决办法】: 需要在jenkins调用shell脚

编译linux内核出现 arm-eabi-gcc: error: : No such file or directory

external/e2fsprogs/lib/ext2fs/tdb.c:673:29: warning: comparison between : In function 'max2165_set_params': -。。。。。。。。。。。。。。。。。。 。。。。。。。。。。。。。 。。。。。。。。 host asm: libdvm <= dalvik/vm/mterp/out/Inte

收藏:解决 pip install 出现 error: subprocess-exited-with-error 错误的方法

在使用 pip 安装 Python 包时,有时候会遇到 error: subprocess-exited-with-error 错误。这种错误通常是由于 setuptools 版本问题引起的。本文将介绍如何解决这一问题 当你使用 pip install 安装某个 Python 包时,如果 setuptools 版本过高或过低,可能会导致安装过程出错,并出现类似以下错误信息:error: subpr

Nn criterions don’t compute the gradient w.r.t. targets error「pytorch」 (debug笔记)

Nn criterions don’t compute the gradient w.r.t. targets error「pytorch」 ##一、 缘由及解决方法 把这个pytorch-ddpg|github搬到jupyter notebook上运行时,出现错误Nn criterions don’t compute the gradient w.r.t. targets error。注:我用