상세 컨텐츠

본문 제목

GitHub에서 Repository 생성 후 Jupyter Lab 환경 설정하기

경험 리뷰/한국경제 with Tossbank

by shok11 2024. 8. 25. 14:07

본문

728x90
반응형

[K-Digital Training] 한국경제신문 with toss bank

 

 

https://github.com/

 

GitHub: Let’s build from here

GitHub is where over 100 million developers shape the future of software, together. Contribute to the open source community, manage your Git repositories, review code like a pro, track bugs and fea...

github.com

1. GitHub에서 Repository 생성하기

먼저 GitHub에 로그인한 후, 새로운 Repository를 생성합니다.

  1. GitHub 메인 페이지에서 오른쪽 상단의 '+' 버튼을 클릭하고 'New repository'를 선택합니다.
  2. Repository 이름을 입력하고, 필요에 따라 설명과 공개 여부(Private/Public)를 선택한 후 'Create repository'를 클릭하여 생성합니다.
  3. 생성된 Repository 페이지로 이동한 후, 오른쪽 상단의 초록색 'Code' 버튼을 클릭하고 'HTTPS' 옵션을 선택하여 Repository URL을 복사합니다.

 

2. Git Bash에서 Repository 클론 하기

복사한 URL을 사용하여 로컬 컴퓨터에 Repository를 클론 합니다.

 

  • 복사한 Repository URL을 사용하여 클론 합니다.
git clone "복사한_Repositorie_URL"

 

  • 클론 된 폴더로 이동합니다.
cd 클론된_폴더명

 

 

3. 필요한 파일 생성하기

클론된 폴더 안에 필요한 파일들을 생성합니다.

 

  • requirements.txt 파일을 생성합니다
touch requirements.txt

 

requirements.txt 의 내용 (메모앱을 이용)

 

numpy
pandas
matplotlib
seaborn
plotly
scikit-learn
jupyterlab
streamlit
pingouin
scipy
chardet
gdown
xlsxwriter
sqlalchemy
beautifulsoup4

 

4. Visual Studio Code에서 작업하기

이제 Visual Studio Code (VSCode)를 열어 개발 환경을 설정합니다.

  • VSCode에서 클론 된 폴더를 엽니다. 
code .

 

메뉴에서 'Terminal > New Terminal'을 선택합니다.

 

5. 가상환경 설정하기

Python 가상환경을 설정하여 독립된 작업 환경을 만듭니다.

  • 터미널에서 virtualenv 패키지를 설치합니다.
pip install virtualenv
  • virtualenv venv
virtualenv venv
  • 생성한 가상환경을 활성화.
source venv/Scripts/activate
  • 가상환경이 제대로 활성화되었는지 확인
which python

 

6. 패키지 설치하기

  • requirements.txt 파일에 명시된 패키지들을 설치합니다.
pip install -r requirements.txt
  • 터미널에서 Jupyter Lab을 실행
jupyter lab

 

이제 브라우저가 열리면서 Jupyter Lab에서 코드를 작성하고 실행할 수 있는 준비가 완료되었습니다.

728x90
반응형

관련글 더보기