Extension 설치
- Remote Development를 검색하여 설치
VSCode와 Container 연결
F1
키 또는Ctrl
+Shift
+ p 를 이용하여 커맨드 라인을 입력할 수 있게 만들기- Remote-Containers: Attach to Running Container... 를 선택하면 해당 Container로 연결됨
- 개발하기 위한 폴더를 선택하면 해당 소스코드를 VSCode에서 볼 수 있음
:h3:참조
Docker container 코드 실행 시 Locale 문제
- 코드
apt-get install locales vi /etc/default/locale
# 아래 내용 추가하기 LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8
# 위 작업으로 안되면 아래 명령어 실행 (158 → 3) sudo dpkg-reconfigure locales
원하는 Python interpreter로 컴파일되지 않을 때
Ctrl
+Shift
+P
로 Python: Select Interpreter를 선택한 후 원하는 Python을 선택할 수 있음- 참조: Visual Studio Code > Docs, Using Python environments in VS Code
Ctrl
+ Shift
+ P
를 이용하여 Python: Select Interpreter 를 선택한 후 원하는 Interpreter으로 설정할 수 있다.
우선, ipykernel이 설치되어 있어야 Jupyter notebook을 VSCode에서 실행할 수 있다. Jupyter notebook 오른쪽 상단에 현재 활성화되어 있는 Python을 변경할 수 있다.