본문 바로가기
프로젝트/PYTHON

파이썬 공학 프로그램 개발 환경 구축 가이드

by 도서관경비원 2026. 4. 8.
반응형

🏗️ 전체 스택 구성

구성요소 선택 이유
Python 3.12 (최신 안정) 최신 기능, 성능 개선
패키지 관리 uv pip보다 10~100배 빠름, 가상환경 통합
IDE PyCharm Community 무료, Python 전용, 강력한 디버거
GUI 프레임워크 PySide6 Qt6 공식 Python 바인딩, LGPL 무료
과학 스택 NumPy + SciPy + Matplotlib 표준 공학 라이브러리
버전 관리 Git 필수

1단계: Python 설치

Windows

# 공식 사이트에서 Python 3.12 다운로드
# https://www.python.org/downloads/
# ✅ 반드시 "Add Python to PATH" 체크!

# 또는 winget
winget install Python.Python.3.12

# 확인
python --version

Linux (Ubuntu/Debian)

sudo apt update
sudo apt install python3.12 python3.12-venv python3.12-dev build-essential git -y

# 확인
python3.12 --version

2단계: uv 설치

Windows

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

# 터미널 재시작 후 확인
uv --version

Linux (Ubuntu/Debian)

curl -LsSf https://astral.sh/uv/install.sh | sh
source ~/.bashrc

# 확인
uv --version

3단계: 프로젝트 생성 및 라이브러리 설치

# 프로젝트 생성
uv init my-engineering-app
cd my-engineering-app

# Python 버전 고정
uv python pin 3.12

# 핵심 라이브러리 설치
uv add numpy scipy matplotlib PySide6

# 개발 도구
uv add --dev pytest

# 설치 확인
uv pip list

4단계: PyCharm Community 설치

Windows

# 공식 사이트에서 다운로드 (권장)
# https://www.jetbrains.com/pycharm/download/ → Community Edition

Linux (Ubuntu/Debian)

# 공식 사이트에서 다운로드 (권장)
# https://www.jetbrains.com/pycharm/download/ → Community Edition
# 압축 해제 후 /bin/pycham 실행

5단계: PyCharm에서 프로젝트 열기 및 인터프리터 설정

프로젝트 열기

File → Open → my-engineering-app 폴더 선택

인터프리터 설정 (가장 중요!)

File → Settings → Project → Python Interpreter
  → Add Interpreter → Add Local Interpreter
  → Existing → 경로 입력:

  Windows : C:\Users\<user>\my-engineering-app\.venv\Scripts\python.exe
  Linux   : /home/<user>/my-engineering-app/.venv/bin/python

uv 가상환경 경로 확인 방법

# 터미널에서 실행
uv run which python    # Linux
uv run where python    # Windows

6단계: PyCharm 추천 설정

유용한 플러그인 설치

File → Settings → Plugins → Marketplace 검색

 

플러그인 기능
Ruff 초고속 린터
Rainbow Brackets 괄호 색상 구분
GitToolBox Git 상태 인라인 표시
Qt Style Sheets QSS 문법 강조

코드 포매터 설정 (Black)

File → Settings → Tools → Black
  → ✅ On code reformat
  → ✅ On save
# Black 설치
uv add --dev black

7단계: Git 설치

Windows

winget install Git.Git

Linux

sudo apt install git -y

초기 설정

git config --global user.name "Your Name"
git config --global user.email "you@example.com"

cd my-engineering-app
git init
git add .
git commit -m "Initial project setup"

8단계: 동작 확인

# 터미널에서 실행
uv run python test_env.py

PyCharm 내부 터미널에서도 동일하게 실행 가능:

View → Tool Windows → Terminal

🔑 핵심 요약

Python 3.12  →  uv (패키지/가상환경)  →  PyCharm Community (IDE)
      ↓
NumPy + SciPy + Matplotlib + PySide6
      ↓
Git로 버전 관리

PyCharm Community는 Python 전용 IDE라 자동완성, 디버거, 가상환경 인식이 VS Code보다 훨씬 직관적입니다. 인터프리터만 .venv로 정확히 설정하면 PySide6도 바로 인식됩니다! 😊

반응형