반응형

 

파이썬 개발 환경 구성

파이썬 개발 환경 구성

Poetry

  • Poetry : dependency management and packaging in Python

requires

  • Python 3.8+

지원 OS

  • Linux, macOS, Windows 지원

윈도우 설치 방법

  1. Poetry 설치
    1. WSL 사용하는 경우
      curl -sSL https://install.python-poetry.org | python3 -
    1. Powershell 사용하는 경우
      (Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | py -
  1. Poetry 환경 변수 등록
    1. 시스템 속성 > 환경 변수 >시스템 변수 > 아래 path 추가
      %APPDATA%\Python\Scripts 
    1. `APPDATA`가 정의되어 있지 않다면 아래 Path 추가
      C:\Users\사용자_윈도우_계정\AppData\Roaming\Python\Scripts\Python\Scripts
  1. 설치 확인
    1. 버전 확인
      >poetry --version
      Poetry (version 1.8.2)

  1. 업데이트
    1. self update
      >poetry self update
      Updating Poetry version ...
      
      Using version ^1.8.2 for poetry
      
      Updating dependencies
      Resolving dependencies... (7.9s)
      
      No dependencies to install or update
      
      Writing lock file
  1. 실습
    1. 실습할 폴더 생성 후 초기 세팅 진행
      mkdir test
      cd test
      poetry init
    1. 초기 세팅 내용
      >poetry init
      
      This command will guide you through creating your pyproject.toml config.
      
      Package name [2404_langchain]:
      Version [0.1.0]:
      Description []:
      Author [frontmulti <frontmulti@gmail.com>, n to skip]:
      License []:
      Compatible Python versions [^3.8]:
      
      Would you like to define your main dependencies interactively? (yes/no) [yes] no
      Would you like to define your development dependencies interactively? (yes/no) [yes] no
      Generated file
      
      [tool.poetry]
      name = "2404-langchain"
      version = "0.1.0"
      description = ""
      authors = ["frontmulti <frontmulti@gmail.com>"]
      readme = "README.md"
      
      [tool.poetry.dependencies]
      python = "^3.8"
      
      
      [build-system]
      requires = ["poetry-core"]
      build-backend = "poetry.core.masonry.api"
      
      
      Do you confirm generation? (yes/no) [yes]
    1. 생성 파일 확인
      1. `pyproject.toml`
      [tool.poetry]
      name = "2404-langchain"
      version = "0.1.0"
      description = ""
      authors = ["frontmulti <frontmulti@gmail.com>"]
      readme = "README.md"
      
      [tool.poetry.dependencies]
      python = "^3.8"
      
      
      [build-system]
      requires = ["poetry-core"]
      build-backend = "poetry.core.masonry.api"
      




      반응형

      + Recent posts