ModuleNotFoundError: No module named 'conda'

I cannot use any of the conda commands in JupyterLab. I can use them in Anaconda prompt. Why is this?

P.S. Previously, the command conda install xxx could be used. However, now you get the following error message:

Traceback (most recent call last):
  File "C:\Users\emanon\anaconda3\Scripts\conda-script.py", line 11, in <module>
    from conda.cli import main
ModuleNotFoundError: No module named 'conda'

You are likely not running conda in the default ‘base’ environment loaded when running in JupyterLab.

You can activate the base environment, by running:

!conda activate base

in JupyterLab.

thanks.

And I realised after posting this thread that, in fact, the command I ran was conda install xxx, not !conda install xxx.

I used to be able to install it in JupyterLab just by doing conda install xxx, and without appending -y.

For some reason, now I cannot install in JupyterLab without doing !conda install xxx -y. How can I install the module by just doing !conda install xxx as before?

I have just checked and it seems that a complete uninstallation has fixed the problem.

1 Like