Python

[VSCode] jupyter notebook 사용

비번변경 2022. 4. 19. 21:35

VSCode는 python 개발 환경으로 많이 사용되지만, 데이터 분석 관련으로는 아무래도 jupyter notebook과 jupyterlab이 많이 사용된다.

즉, jupyter notebook도 새로 설치를 하게 되는데, VScode의 관련 확장 프로그램 몇 가지를 설치하면 VSCode 상에서도 jupyter notebook을 사용할 수 있게 된다.

설정 방법을 정리해둔다.

 

방법

1. VSCode 설치

아래의 링크에서 환경에 맞는 버전을 다운받아 설치한다.

https://code.visualstudio.com/download

 

Download Visual Studio Code - Mac, Linux, Windows

Visual Studio Code is free and available on your favorite platform - Linux, macOS, and Windows. Download Visual Studio Code to experience a redefined code editor, optimized for building and debugging modern web and cloud applications.

code.visualstudio.com

 

2. VSCode 실행 및 Extension으로 접근

아래의 확장 프로그램을 설치한다.

  • Python
  • Python for VSCode
  • Python Extension Pack
  • Jupyter (미설치 시 실제 notebook 생성 및 동작 시 자동으로 설치된다. 확장 프로그램 뿐만 아니라 python 환경에 jupyter 관련 라이브러리도 설치된 것 같다.)

 

3. 명령 팔레트를 이용해 주피터 노트북 생성

명령 팔레트는 메뉴의 View > Command Palette 를 클릭하여 이용할 수 있다.

단축키는 Ctrl + Shift + P이다.

명령 팔레트에서 Create: New Jupyter Notebook을 선택한다.

 

4. 노트북이 정상적으로 생성/동작하는지 확인

728x90