C.W.K.
Stream
Lesson 03 of 05 · published

매일 치는 pixi 명령

~12 min · pixi, commands, workflow

Level 0초심자
0 XP0/55 lessons0/16 achievements
0/80 XP to next level80 XP to go0% complete

pixi 의 CLI 가 Cargo / npm / uv 미러. 대부분 머슬메모리 transfer.

pixi init <dir> 가 프로젝트 생성 (pixi.toml + .gitignore). pixi add <pkg> 가 conda-forge 패키지 추가. pixi add --pypi <pkg> 가 PyPI 패키지 추가 (uv 통해 resolve). pixi add --feature dev <pkg> 가 feature 그룹 (pixi 의 dev deps 등가물) 에 추가. pixi remove <pkg> 가 제거.

pixi run <cmd> 가 프로젝트 환경에서 명령 실행 — 수동 활성화 없음. pixi run python script.py, pixi run pytest, pixi run jupyter lab 다 그냥 작동. pixi shell 이 env active 한 인터랙티브 shell 열기.

pixi global install <tool> 가 isolated deps 가진 CLI 도구 글로벌 install — 평소 brew 통해 install 할 많은 CLI 도구 대체. pixi global list 가 표시. pixi global remove <tool> 가 uninstall.

pixi list 가 이 프로젝트에 install 된 패키지 표시. pixi tree 가 의존성 트리 표시. pixi search <name> 이 패키지 찾음.

Code

모던 pixi 워크플로우 — 새 프로젝트·bash
# 부트스트랩
pixi init myproject && cd myproject

# conda-forge 패키지 추가
pixi add python=3.12 numpy pandas matplotlib jupyterlab

# PyPI 패키지 추가 (내부적으로 uv 통해 resolve)
pixi add --pypi flask requests

# dev-only deps 를 feature 그룹에
pixi add --feature dev pytest ruff mypy

# 실행 — activate 안 필요
pixi run python -c "import numpy; print(numpy.__version__)"
pixi run pytest
pixi run jupyter lab

# 또는 인터랙티브 shell 로
pixi shell
Tasks — Makefile 대체·toml
# pixi.toml — 보통 작업을 task 로 정의
[tasks]
train = "python train.py"
test = "pytest -v"
lint = "ruff check ."
fmt = "ruff format ."
start = { cmd = "python serve.py", depends_on = ["train"] }

# 그 다음:
#   pixi run train
#   pixi run test
#   pixi run start    ← train 먼저 (depends_on), 그 다음 start
pixi global — Homebrew CLI 도구 대체·bash
# isolated deps 와 CLI 도구 글로벌 install
pixi global install ripgrep bat fd gh
pixi global install --pypi httpie

# 각 도구가 자기 private env 받음 — 절대 충돌 없음
pixi global list
pixi global upgrade --all

External links

Exercise

pixi 로 프로젝트 부트스트랩: 'pixi init test && cd test && pixi add python pytorch -c pytorch && pixi run python -c "import torch; print(torch.__version__)"'. pixi.toml 과 pixi.lock 봐 — CUDA 가능 env 의 전체 재현성 스토리.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.