Programming Basics
[Google Cloud Platform] github 연동, 가상환경 복제(예정)
ISLA!
2023. 10. 18. 13:20
깃허브에서 파일 생성
- GCP와 연동된 깃허브 저장소 >> 파일 생성 >> 다음 파일을 입력하고 >> Commit changes..
- 라이브러리를 설치할 requirementx.txt를 만든다
GCP 접속, git pull
위에서 만든 파일로 라이브러리 설치
$ pip install -r requirements.txt
파일을 수정하고 싶다면, vi 편집기로 수정
$ vi requirements.txt
주피터 노트북 접속
$ jupyter notebook
👉 IP:8888(포트번호) 과 같은 방식으로 주소 입력하여 주피터 노트북 접속
👉 다음 코드를 입력하고 간단히 결과를 확인해 본다
import pandas as pd
import pyspark
import streamlit as st
import matplotlib
print(pd.__version__)
print(pyspark.__version__)
print(st.__version__)
print(matplotlib.__version__)
가상환경 복제
[참고] conda environmnet.yaml 형식
- 언제 필요한지, 어떻게 쓰는지 체크하기
name: base
channels:
- defaults
dependencies:
- python=3.11.4
- pip
- pip:
- matplotlib
- sklearn
prefix: /home/your_id/miniconda3
728x90