안녕하세요 여러분, 데잇입니다. 이전 시간에 이어 POETRY 가상환경을
vs code에 적용하여 대화형 환경인 jupyter notebook을 설정하고 이용해봅시다.
POETRY 활용법
jupyter notebook kernel 설정
- bash
$ poetry shell
$ poetry add jupyter ipykernel
$ poetry run python -m ipykernel install --user --name [가상환경 이름] --display-name "[jupyter에 표시될 kernel의 이름]"
- python에서 ipykernel 모듈을 실행(-m)하여 install 작업을 한다는 의미
$ jupyter notebook
: URI 주소가 출력된다
- VScode
- Jupyter: Specify jupyter server for connections 선택 > EXISTING선택 > 위 주소 입력
- 재실행 후 command + shift + p를 눌러 python interpreter로 가상환경 python interpreter를 연결