0

本題

JupyterLabでcondaコマンドを使えるようにするにはどうしたらいいでしょうか?

経緯

JupyterLabで仮想環境の削除をしようとしたときに,先に

jupyter kernelspec uninstall environment_name

を実行してから

conda remove -n 環境名 --all

を実行しました.そのあと,この「仮想環境の削除」が原因でないかもしれませんが,conda installなどのcondaコマンドを使用できなくなりました.この操作をする以前は問題なく使えていました.

conda install コマンドを実行したときに出力されるエラーメッセージ:

Note: you may need to restart the kernel to use updated packages.
Traceback (most recent call last):
  File "C:\Users\username\anaconda3\Scripts\conda-script.py", line 11, in <module>
    from conda.cli import main
ModuleNotFoundError: No module named 'conda'

conda-script.pyの中身:

# -*- coding: utf-8 -*-
import sys
# Before any more imports, leave cwd out of sys.path for internal 'conda shell.*' commands.
# see https://github.com/conda/conda/issues/6549
if len(sys.argv) > 1 and sys.argv[1].startswith('shell.') and sys.path and sys.path[0] == '':
    # The standard first entry in sys.path is an empty string,
    # and os.path.abspath('') expands to os.getcwd().
    del sys.path[0]

if __name__ == '__main__':
    from conda.cli import main
    sys.exit(main())

試したこと

Anaconda Navigatorをアンインストールしてから再インストールをしました.しかし改善されず.

4

0

この質問に回答するには、ログインする必要があります。

のタグが付いた他の質問を参照する。