conda: command not found

本文介绍了如何解决Anaconda环境下conda命令不可用的问题,并详细解释了如何通过设置环境变量来激活虚拟环境。此外,还提供了conda命令的常用选项说明。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

我们在用别人的tensorflow源代码的时候,常常需要用到特定版本的tensorflow版本,这个时候,我们就考虑使用anaconda提供的虚拟环境,我安装的anaconda版本是:

Anaconda3-4.4.0-Linux-x86_64.sh

当时我把环境变量里面关于anaconda的那一项给注释掉了,所以当我们使用里面的conda命令来激活自己的虚拟环境的时候,会报这个错误,我的输出为:

whsyxt@whsyxt:~/anaconda3/envs$ conda env SSDtf1_2/
conda: command not found

这个时候,我们需要把它添加大环境变量中去,才能用conda命令,我的操作为:

export PATH=~/anaconda3/bin:$PATH

我的输出信息为:

whsyxt@whsyxt:~/anaconda3/envs$ export PATH=~/anaconda3/bin:$PATH
whsyxt@whsyxt:~/anaconda3/envs$ conda
usage: conda [-h] [-V] command ...

conda is a tool for managing and deploying applications, environments and packages.

Options:

positional arguments:
  command
    info         Display information about current conda install.
    help         Displays a list of available conda commands and their help
                 strings.
    list         List linked packages in a conda environment.
    search       Search for packages and display their information. The input
                 is a Python regular expression. To perform a search with a
                 search string that starts with a -, separate the search from
                 the options with --, like 'conda search -- -h'. A * in the
                 results means that package is installed in the current
                 environment. A . means that package is not installed but is
                 cached in the pkgs directory.
    create       Create a new conda environment from a list of specified
                 packages.
    install      Installs a list of packages into a specified conda
                 environment.
    update       Updates conda packages to the latest compatible version. This
                 command accepts a list of package names and updates them to
                 the latest versions that are compatible with all other
                 packages in the environment. Conda attempts to install the
                 newest versions of the requested packages. To accomplish
                 this, it may update some packages that are already installed,
                 or install additional packages. To prevent existing packages
                 from updating, use the --no-update-deps option. This may
                 force conda to install older versions of the requested
                 packages, and it does not prevent additional dependency
                 packages from being installed. If you wish to skip dependency
                 checking altogether, use the '--force' option. This may
                 result in an environment with incompatible packages, so this
                 option must be used with great caution.
    upgrade      Alias for conda update. See conda update --help.
    remove       Remove a list of packages from a specified conda environment.
    uninstall    Alias for conda remove. See conda remove --help.
    config       Modify configuration values in .condarc. This is modeled
                 after the git config command. Writes to the user .condarc
                 file (/home/whsyxt/.condarc) by default.
    clean        Remove unused packages and caches.
    package      Low-level conda package utility. (EXPERIMENTAL)

optional arguments:
  -h, --help     Show this help message and exit.
  -V, --version  Show the conda version number and exit.

other commands, such as "conda build", are available when additional conda
packages (e.g. conda-build) are installed

参考文献

[1].How to run Conda?.https://stackoverflow.com/questions/18675907/how-to-run-conda

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

农民小飞侠

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值