| ## π μ¬μ μ€λΉ | |
| ### νμ μ€μΉ νλͺ© | |
| 1. **Python 3.12.3** | |
| 2. **pyenv** (Python λ²μ κ΄λ¦¬) | |
| 3. **Poetry** (μμ‘΄μ± κ΄λ¦¬) | |
| ### μ€μΉ λ°©λ² | |
| #### πͺ Windows | |
| ```powershell | |
| # 1. pyenv-win μ€μΉ | |
| Invoke-WebRequest -UseBasicParsing -Uri "https://raw.githubusercontent.com/pyenv-win/pyenv-win/master/pyenv-win/install-pyenv-win.ps1" -OutFile "./install-pyenv-win.ps1" | |
| & "./install-pyenv-win.ps1" | |
| # PowerShell μ¬μμ ν | |
| # 2. Python 3.12.3 μ€μΉ | |
| pyenv install 3.12.3 | |
| # 3. Poetry μ€μΉ | |
| (Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | python - | |
| ``` | |
| #### π Mac/Linux | |
| ```bash | |
| # 1. pyenv μ€μΉ | |
| curl https://pyenv.run | bash | |
| # νκ²½ λ³μ μ€μ (zsh κΈ°μ€) | |
| echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc | |
| echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc | |
| echo 'eval "$(pyenv init -)"' >> ~/.zshrc | |
| source ~/.zshrc | |
| # 2. Python 3.12.3 μ€μΉ | |
| pyenv install 3.12.3 | |
| # 3. Poetry μ€μΉ | |
| curl -sSL https://install.python-poetry.org | python3 - | |
| ``` | |
| --- | |
| ## π νκ²½ μ€μ | |
| ### 1. μ μ₯μ ν΄λ‘ | |
| #### πͺ Windows | |
| ```powershell | |
| git clone | |
| cd Codeit-AI-1team-LLM-project | |
| ``` | |
| #### π Mac/Linux | |
| ```bash | |
| git clone | |
| cd Codeit-AI-1team-LLM-project | |
| ``` | |
| ### 2. Python λ²μ μ€μ | |
| νλ‘μ νΈ ν΄λμ `.python-version` νμΌμ΄ μμΌλ©΄ μλμΌλ‘ Python 3.12.3μ μ¬μ©ν©λλ€. | |
| #### πͺ Windows | |
| ```powershell | |
| # νμΈ | |
| python --version | |
| # Python 3.12.3μ΄ μλλ©΄: | |
| pyenv local 3.12.3 | |
| ``` | |
| #### π Mac/Linux | |
| ```bash | |
| # νμΈ | |
| python --version | |
| # Python 3.12.3μ΄ μλλ©΄: | |
| pyenv local 3.12.3 | |
| ``` | |
| ### 3. Poetry μ€μ | |
| #### πͺ Windows | |
| ```powershell | |
| # κ°μνκ²½μ νλ‘μ νΈ λ΄λΆμ μμ± | |
| python -m poetry config virtualenvs.in-project true | |
| ``` | |
| #### π Mac/Linux | |
| ```bash | |
| poetry config virtualenvs.in-project true | |
| ``` | |
| --- | |
| ## π¦ μμ‘΄μ± μ€μΉ | |
| `poetry.lock` νμΌμ κΈ°μ€μΌλ‘ μ νν λμΌν λ²μ μ ν¨ν€μ§λ₯Ό μ€μΉν©λλ€. | |
| #### πͺ Windows | |
| ```powershell | |
| # Python λ²μ μ§μ | |
| python -m poetry env use 3.12.3 | |
| # μμ‘΄μ± μ€μΉ | |
| python -m poetry install | |
| # κ°μνκ²½ νμ±ν | |
| python -m poetry shell | |
| ``` | |
| #### π Mac/Linux | |
| ```bash | |
| # Python λ²μ μ§μ | |
| poetry env use 3.12.3 | |
| # μμ‘΄μ± μ€μΉ | |
| poetry install | |
| # κ°μνκ²½ νμ±ν | |
| poetry shell | |
| ``` | |
| **μ€μΉ μλ£ νμΈ:** | |
| ν둬ννΈ μμ `(.venv)`κ° λΆμΌλ©΄ μ±κ³΅! β | |
| ``` | |
| (.venv) PS C:\Codeit-AI-1team-LLM-project> # Windows | |
| (codeit-ai-1team-llm-project-py3.12) user@computer:~/project$ # Mac/Linux | |
| ``` | |
| --- | |
| ## π― νλ‘μ νΈ μ€ν | |
| ### κΈ°λ³Έ μ€ν | |
| #### πͺ Windows | |
| ```powershell | |
| # κ°μνκ²½μ΄ νμ±νλ μνμμ | |
| python main.py | |
| ``` | |
| #### π Mac/Linux | |
| ```bash | |
| # κ°μνκ²½μ΄ νμ±νλ μνμμ | |
| python main.py | |
| ``` | |
| ### κ°μνκ²½ λκ°κΈ° | |
| #### πͺ Windows & Mac/Linux | |
| ```bash | |
| exit | |
| ``` | |
| --- | |
| ## π₯ κ°λ° κ°μ΄λ | |
| ### μΌμμ μΈ μμ νλ¦ | |
| #### πͺ Windows | |
| ```powershell | |
| # 1. νλ‘μ νΈ ν΄λλ‘ μ΄λ | |
| cd C:\Codeit-AI-1team-LLM-project | |
| # 2. μ΅μ μ½λ λ°κΈ° | |
| git pull | |
| # 3. μμ‘΄μ± μ λ°μ΄νΈ (νμμ΄ ν¨ν€μ§ μΆκ°ν κ²½μ°) | |
| python -m poetry install | |
| # 4. κ°μνκ²½ νμ±ν | |
| python -m poetry shell | |
| # 5. κ°λ° μμ ... | |
| # 6. μμ μ’ λ£ | |
| exit | |
| ``` | |
| #### π Mac/Linux | |
| ```bash | |
| # 1. νλ‘μ νΈ ν΄λλ‘ μ΄λ | |
| cd ~/Codeit-AI-1team-LLM-project | |
| # 2. μ΅μ μ½λ λ°κΈ° | |
| git pull | |
| # 3. μμ‘΄μ± μ λ°μ΄νΈ (νμμ΄ ν¨ν€μ§ μΆκ°ν κ²½μ°) | |
| poetry install | |
| # 4. κ°μνκ²½ νμ±ν | |
| poetry shell | |
| # 5. κ°λ° μμ ... | |
| # 6. μμ μ’ λ£ | |
| exit | |
| ``` | |
| ### μ ν¨ν€μ§ μΆκ° | |
| #### πͺ Windows | |
| ```powershell | |
| # ν¨ν€μ§ μΆκ° | |
| python -m poetry add | |
| # μ: requests μΆκ° | |
| python -m poetry add requests | |
| # κ°λ° λꡬ μΆκ° | |
| python -m poetry add --group dev pytest | |
| # Git μ»€λ° | |
| git add pyproject.toml poetry.lock | |
| git commit -m "Add " | |
| git push | |
| ``` | |
| #### π Mac/Linux | |
| ```bash | |
| # ν¨ν€μ§ μΆκ° | |
| poetry add | |
| # μ: requests μΆκ° | |
| poetry add requests | |
| # κ°λ° λꡬ μΆκ° | |
| poetry add --group dev pytest | |
| # Git μ»€λ° | |
| git add pyproject.toml poetry.lock | |
| git commit -m "Add " | |
| git push | |
| ``` | |
| --- | |
| ## π λ¬Έμ ν΄κ²° | |
| ### Python λ²μ μ΄ 3.12.3μ΄ μλμμ | |
| #### πͺ Windows | |
| ```powershell | |
| pyenv local 3.12.3 | |
| python --version | |
| ``` | |
| #### π Mac/Linux | |
| ```bash | |
| pyenv local 3.12.3 | |
| python --version | |
| ``` | |
| ### Poetry λͺ λ Ήμ΄λ₯Ό μ°Ύμ μ μμ΄μ | |
| #### πͺ Windows | |
| ```powershell | |
| # Poetryλ₯Ό python λͺ¨λλ‘ μ€ν | |
| python -m poetry --version | |
| # PATH μΆκ° (μꡬμ ) | |
| [Environment]::SetEnvironmentVariable("Path", [Environment]::GetEnvironmentVariable("Path", "User") + ";$env:APPDATA\Python\Scripts", "User") | |
| ``` | |
| #### π Mac/Linux | |
| ```bash | |
| # PATH μΆκ° | |
| export PATH="$HOME/.local/bin:$PATH" | |
| # μꡬ μ μ© | |
| echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc | |
| source ~/.zshrc | |
| ``` | |
| ### Import μλ¬κ° λμ | |
| ```bash | |
| # κ°μνκ²½μ΄ νμ±νλμ΄ μλμ§ νμΈ | |
| # ν둬ννΈμ (.venv)κ° μμ΄μΌ ν¨ | |
| # μλ€λ©΄ λ€μ νμ±ν | |
| poetry shell # Mac/Linux | |
| python -m poetry shell # Windows | |
| # μμ‘΄μ± μ¬μ€μΉ | |
| poetry install # Mac/Linux | |
| python -m poetry install # Windows | |
| ``` |