Skip to main content

Command Palette

Search for a command to run...

Setting up Python development environment

파이썬 개발 환경의 설정, 계절학기 2주차

Updated
4 min read
Setting up Python development environment

Contents

1️⃣ 개발 환경의 이해 (Understanding the development environment)
2️⃣ 클라우드 개발 환경 설정하기 (Setting up cloud development environments)
3️⃣ 로컬 개발 환경 설정하기 (Setting up local development environments)


**1️⃣ 개발 환경의 이해

(Understanding the development environment)**

클라우드 개발 환경(Cloud development environment)

Easier Setup: 비교적 쉽게 개발 환경을 설정할 수 있다.
Pay-as-You-Go: 자원을 사용한 만큼만 비용을 지불한다.
Internet Dependency: 인터넷이 되는 환경에서만 사용 가능하다.
Scalability: 컴퓨팅 자원의 규모를 탄력적으로 변경이 가능하다.

로컬 개발 환경 (Local development environment)

Exclusive Ownership: 프로그래밍 환경을 단독으로 소유한다.
Lower Long-term Costs: 컴퓨팅 자원의 장시간 사용시 비용 부담이 낮다.
Offline Capability: 인터넷이 지원 되지 않은 환경에서도 사용할 수 있다.
Security Flexibility: 보안성 문제에 있어 비교적 자유롭다.

✅ 개발 환경의 구조 (Structure of DE)

위의 언급된 두 환경에서 공통적으로 적용된다.

  • 운영체제에 따라 Virtual Machine도 다르다.

  • 디버깅(Debugging) 의도치 않게 발생한 버그의 문제를 찾아 해결하는 과정을 뜻한다.


2️⃣ 클라우드 개발 환경 설정하기

(Setting up cloud development environments)

✅ Colab 의 개요 (Overview of Colaboratory)

무료로 개방된 개발 환경 (Freely Available Development Environment)
구글에서 교육과 과학 연구를 목적으로 개발하였다. 파이썬 코드 작성 및 수행 가능한 환경이 모두 제공된다. 작성된 코드는 구글 드라이브에 저장이 가능하다. (HDD의 역할 = 구글 드라이브) 전체 세션 유지 시간은 최대 12시간이다. (12시간이 지나기 전데 구글 드라이브에 저장하면 계속 작성이 가능하다.)

하드웨어 가속기 지원(Support for Hardware Accelerators)
GPU, TPU 등의 가속기를 이용한 개발환경을 지원한다.

  • GPU (Graphics Processing Unit): is a specialized electronic circuit designed to accelerate the processing of images and videos. GPUs are highly efficient at performing parallel operations, making them ideal for tasks that require large-scale computations such as:

    • Graphics Rendering: Used in gaming and 3D rendering applications.

    • Machine Learning: Accelerates the training and inference of neural networks.

    • Scientific Computation: Handles complex mathematical computations in scientific research.

  • TPU (Tensor Processing Unit): is a type of application-specific integrated circuit (ASIC) developed by Google specifically for accelerating machine learning workloads. TPUs are designed to handle tensor operations, which are the core computations in neural networks, making them highly efficient for:

    • Deep Learning: Optimized for training and running deep learning models.

    • AI Applications: Enhances the performance of AI-related tasks like natural language processing and image recognition.

    • Cloud AI Services: Widely used in Google's cloud services for scalable machine learning solutions.

Both GPUs and TPUs provide significant performance improvements over traditional CPUs for specific types of computational tasks, particularly in the fields of machine learning and artificial intelligence.


✅Colab의 구조(Structure of Colab)

User Computer - 우리가 사용하는 컴퓨터이다. 구글 드라이브 내에 구글 데스크탑을 설치한다.

Drive Backup & Sync - 구글 데스크탑 설치시, PC와 구글 드라이브의 파일들이 동기화 되어 실시간으로 파일이 업데이트가 된다.

Google Drive - 이 부분부터를 '클라우드 환경'이라고 한다. 코드를 저장하는 HDD의 역할을 한다.


colab은 리눅스 운영체제에서 동작한다. Colab 실습자료 아래 링크

https://colab.research.google.com/drive/10lIPqVFbO_3tEOa4Q2oQLaPUHiHva9Z2


3️⃣ 로컬 개발 환경 설정하기

(Setting up local development environments)

✅Visual Studio Code의 개요 (Overview of VS Code)

오픈소스로 공개된 코드 에디터(Open source code editor)
비교적 가벼운 코드 에디터로 뛰어난 확장성을 가지고 있다. 파이썬뿐만 아니라 다른 고급언어로도 개발이 가능하다. 필요한 개발환경을 플러그인 형태로 확장 가능하다. VS 코드 내에서 레고 블럭을 쌓듯이 설치할 수 있어서 편하다. 코드 자동완성, 하이라이트 등의 개발 편의성 제공을 제공한다. 마지막으로 파이썬 ipynb 코드 수행을 지원한다. ipynb는 웹으로 바로 결과를 지원하는 대화형 형식의 확장자이다.

클라우드 환경의 런타임 환경 지원(Runtime environment in the cloud)
클라우드 자원을 활용한 코드 수행이 가능하다.

✅VS Code의 구조 (Structure of VS Code)

Python Interpreter

  • An interpreter that runs Python code. In VS Code, you can select and configure (구성, 환경 설정) different Python interpreters (e.g., system Python, virtual environments, Anaconda).

Git Client

  • An integrated(통합된) Git client that allows you to perform version control operations directly within VS Code, such as cloning repositories, committing changes, pushing/pulling updates, and viewing history.

DB Connector

  • Extensions(확장 기능) that allow you to connect to and interact with databases (e.g., SQL Server, MySQL, PostgreSQL). These connectors enable running queries, managing databases, and visualizing data(데이터 시각화).

Additional Extension Plugins

  • VS Code supports a wide range of extensions and plugins that enhance its functionality. These can include linters, debuggers, themes, and language support, among others. Users can install extensions from the Visual Studio Code Marketplace to customize their development environment.

Summary

  • Python Interpreter: Configurable interpreter for running Python code.

  • Git Client: Integrated version control using Git.

  • DB Connector: Extensions for database connectivity and management.

  • Additional Extension Plugins: Various plugins to extend and enhance functionality(기능).


인터넷 환경이 불안정하거나 보안을 요구하는 곳에서 컴퓨터를 사용하고 있을 경우 VS 코드를 사용할 수 있다.


Quiz