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

相关文章

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。注:我用

[轻笔记]ubuntu shell脚本切换conda环境

source /home/yourhostname/anaconda3/etc/profile.d/conda.sh # 关键!!!conda activate env_name

[轻笔记] jupyter notebook 指定conda虚拟环境

安装插件 conda install nb_conda 进入conda env conda activate ${env_name}conda install ipykernelconda deactivate #3. 运行jupyter notebook conda activate # 需要先进入conda环境,非常重要jupyter notebook 会发现,在ju

src/pyaudio/device_api.c:9:10: fatal error: portaudio.h: 没有那个文件或目录

(venv) shgbitai@shgbitai-C9X299-PGF:~/pythonworkspace/ai-accompany$ pip install pyaudio sounddeviceCollecting pyaudioDownloading PyAudio-0.2.14.tar.gz (47 kB)━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

【20240907问题记录(未解决)】Conda环境问题:SSH与本地环境变量不一致

Conda 允许用户在同一系统上创建多个独立的Python环境。然而,最近遇到了一个奇怪的问题:通过SSH连接到远程Ubuntu机器时,Conda环境变量的行为与本地机器不一致。以下是具体遇到的问题: 1. 问题描述 在本地Ubuntu机器上,我的conda的python版本是3.6,而pip版本可以通过命令 pip --version 查看,显示为: pip 21.3.1 from /ho

ERROR 2003 (HY000): Can't connect to MySQL server on (10061)

在linux系统上装了一个mysql-5.5,启动后本机都是可以访问的,操作都正常,同时建了一个%的用户(支持远程访问), root@debian:/# mysql -u loongson -pEnter password: Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id

pip install pyaudio sounddevice error: externally-managed-environment

shgbitai@shgbitai-C9X299-PGF:~/pythonworkspace/ai-accompany$ pip install pyaudio sounddeviceerror: externally-managed-environment× This environment is externally managed╰─> To install Python package