0

I try to run a project named miniGPT-4 on Google Colab. After I installed conda, the environment cannot be activated with the following error:

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')

This is the first time I met the error like this and I have no thought about this. Besides, the entire process I installed conda is based on the tutorial above: https://towardsdatascience.com/conda-google-colab-75f7c867a522. I did not change anything except for the conresponding version (such as change python3.6 to python3.11, and set the conda version as the latest).

Besides, a duplicate question about conda environment on Colab recommends condacolab, which supports only python3.8-. Nevertheless, I tried it but received another error:

CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
To initialize your shell, run

    $ conda init <SHELL_NAME>

Currently supported shells are:
  - bash
  - fish
  - tcsh
  - xonsh
  - zsh
  - powershell

Then I tried to fix this as the return but failed after run the conda init command:

no change     /usr/local/condabin/conda
no change     /usr/local/bin/conda
no change     /usr/local/bin/conda-env
no change     /usr/local/bin/activate
no change     /usr/local/bin/deactivate
no change     /usr/local/etc/profile.d/conda.sh
no change     /usr/local/etc/fish/conf.d/conda.fish
no change     /usr/local/shell/condabin/Conda.psm1
no change     /usr/local/shell/condabin/conda-hook.ps1
no change     /usr/local/lib/python3.10/site-packages/xontrib/conda.xsh
no change     /usr/local/etc/profile.d/conda.csh
no change     /root/.bashrc
No action taken.

I really hope anyone can help me to fix this problem. Many thanks!

speedhawk1
  • 27
  • 5
  • 1
    `conda` has like-named shell script and executable program that have different roles. The executable doesn't understand "activate". This is fixed by executing `conda init` - which will put the shell script in the right place to intercept "acitvate" calls. I don't know exactly how to do that in your colab environment. – tdelaney Aug 23 '23 at 17:19
  • As per duplicate, it is a misconception that one can “activate” a separate Conda environment on Colab and use it in cells. Instead, Conda is used to install additional packages into the Python that is running as the iPython kernel. – merv Aug 23 '23 at 23:09

0 Answers0