Skip to main content

1. WSL2 설치

WSL2를 사용하려면 먼저 Windows에서 이를 활성화하고 Linux 배포판을 설치해야 합니다.

  • Windows 기능 켜기/끄기를 열고, Linux용 Windows 하위 시스템 및 가상 머신 플랫폼을 활성화합니다.

  • PowerShell을 관리자 권한으로 열고 다음 명령어를 입력하여 WSL2로 설정합니다:

    wsl --set-default-version 2
    

    WSL을 사용하여 Windows에 Linux를 설치하는 방법

  • Microsoft Store에서 원하는 Linux 배포판(예: Ubuntu)을 설치합니다.
    WSL의 기본 명령

2. VSCode 설치 및 환경 설정

3. Linux 환경 설정

  • 설치한 Linux 배포판을 시작합니다.
    VSCode에서 Remote - WSL을 설정한 경우 ctl-j를 눌러 WSL의 터미널을 열고, 그 환경에서 작업을 진행 합니다. 아닌 경우 wsl 명령을 입력해 직접 터미널을 열 수 있습니다.
    Developing in WSL
  • 기본적인 도구들을 설치합니다. sudo 암호틑 WSL 실치 시 등록한 암호를 입력 합니다.
    sudo apt update && sudo apt upgrade
    sudo apt install python3-pip python3-venv git -y
    

4. Poetry 설치

Poetry는 Python 프로젝트의 의존성 관리와 패키지 작성을 쉽게 도와주는 도구입니다.

  • Poetry 공식 설치 스크립트를 사용하여 설치합니다:
    curl -sSL https://install.python-poetry.org | python3 -
    
  • 설치 후, shell 설정 파일(.bashrc, .zshrc 등)에 PATH 추가:
    export PATH="$HOME/.local/bin:$PATH"
    
  • 변경사항을 적용하기 위해 쉘을 재시작하거나 source 명령어를 사용합니다:
    source ~/.bashrc
    
  • 프로젝트 별 가상환경을 config에 설정합니다.
    poetry config virtualenvs.in-project true
    
    Basic usage
  • PYPI token 설정
    token은 Didim365 담당자에 수령합니다.
    poetry config pypi-token.gitlab <your-pypi-token>
    

5. 프로젝트 설정

  • 새 프로젝트 폴더를 만들고 해당 폴더로 이동합니다:

    mkdir mylangchainapp && cd mylangchainapp
    
  • Poetry를 사용하여 새 Python 프로젝트를 초기화합니다:

    poetry init
    
  • pyproject.toml 파일을 수정 합니다.

    ...
    [tool.poetry.dependencies]
    python = "^3.11"
    langchain = "^0.1.13"
    pyhcx = ">=0.9.5"
    langchain-hcxai = ">=0.1.6"
    
    [[tool.poetry.source]]
    name = "gitlab"
    url = "https://gitlab.com/api/v4/projects/60349968/packages/pypi/simple"
    priority = "supplemental"
    ...
    
  • 그 외의 필요한 패키지들을 Poetry를 통해 설치합니다. psycopg2-binary 패키지를 예로 들면:

    poetry add psycopg2-binary
    

6. VSCode에서 프로젝트 작업

  • VSCode를 열고, Ctrl+Shift+P를 눌러 Command Palette를 엽니다.
  • "Remote-WSL: New Window"를 선택하여 WSL에서 새 창을 엽니다.
  • 파일 > 폴더 열기...를 선택하고, 프로젝트 디렉토리를 선택합니다.
  • VSCode에서 python 확장을 설치합니다. Python, Pylance, Python Debugger
  • VSCode의 터미널에서 Poetry 환경을 활성화합니다:
    crl-shift-p "Python Interpreter" poetry환경 선택
    
    VSCode: Adding Poetry Python Interpreter

이제 WSL2, VSCode, Poetry를 사용한 LangChain 응용 프로그램 개발 환경이 준비되었습니다. 프로젝트 개발을 시작할 수 있습니다!

Metadata

Release files for langchain-hcxai 0.1.11

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for langchain-hcxai 0.1.11
File Size Uploaded
langchain_hcxai-0.1.11.tar.gz 15.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for langchain-hcxai 0.1.11
File Interpreter ABI Platform
langchain_hcxai-0.1.11-py3-none-any.whl Python 3 none any Details

Total release size: 36.5 kB

Release files / langchain_hcxai-0.1.11.tar.gz

Download URL langchain_hcxai-0.1.11.tar.gz
Size 15.9 kB
Tags Source
SHA-256 checksum
How to use checksums
275a7abe72d591fbe85aea417b397c44c6130fd0acad4353e3267ff04bf43efd
BLAKE2b-256 checksum
How to use checksums
8ef8fe69380e3f8d50f898cd15f0a393396414ff5553e5fc48729e5f978bf5f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.11.9 Darwin/23.6.0

Release files / langchain_hcxai-0.1.11-py3-none-any.whl

Download URL langchain_hcxai-0.1.11-py3-none-any.whl
Size 20.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
326e4ae454a87355726e425f3fabaad522ee7672f2957f1f0ad9a625e0311416
BLAKE2b-256 checksum
How to use checksums
20e2a271aff1ece450ae57f894784b496f66a3fec42049203d466f0f80a9b4e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.11.9 Darwin/23.6.0

Release history Release notifications | RSS feed

This release

0.1.11 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page