Deep Learning

conda env 실행 시 오류 해결

Kimhj 2024. 1. 31. 13:27
  • anaconda 로 env 생성 후 activate 할 때, 아래와 같은 오류가 발생할 때가 있음.

usage: conda [-h] [--no-plugins] [-V] COMMAND ... conda: error: argument COMMAND: invalid choice: 'source'  (choose from 'clean', 'compare', 'config', 'create', 'info', 'init', 'install',  'list', 'notices', 'package', 'remove', 'uninstall', 'rename', 'run', 'search',  'update', 'upgrade', 'build', 'content-trust', 'convert', 'debug', 'develop',  'doctor', 'index', 'inspect', 'metapackage', 'render', 'skeleton', 'token',  'repo', 'env', 'server', 'pack', 'verify')

 

혹은

 

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

 

  • 해결방법은 아래와 같은 명령어를 터미널에 입력하면 된다.

$ source ~/anaconda3/etc/profile.d/conda.sh (anaconda3 경로내 conda.sh)

 

  • 적용 결과, 아래와 같이 오류가 발생하지 않는 것을 볼 수 있다.