Python/독학

개발 환경설정

qqprty 2024. 8. 7. 09:45

1. wsl 설치

https://oddsummer.tistory.com/1

 

[LINUX] WSL로 윈도우에 Linux 설치 (하위 시스템에는 설치된 배포판이 없습니다, 0x8004032d 오류 해결)

wsl로 리눅스 설치하기https://learn.microsoft.com/ko-kr/windows/wsl/install WSL 설치wsl --install 명령을 사용하여 Linux용 Windows 하위 시스템을 설치합니다. Ubuntu, Debian, SUSE, Kali, Fedora, Pengwin, Alpine 등 원하는 Linux

oddsummer.tistory.com

 

2. git 설치

https://oddsummer.tistory.com/4

 

[Git] Git 설치, 초기 설정, 기본 사용법

1. 깃 설치sudo apt-get install git-core 버전 확인git --version 2. 깃 초기설정사용자등록git config --global user.name ''git config --global user.email '' ssh key 생성 -> public key 깃헙 등록.ssh-keygen -t rsa -C -f  pushgit remote

oddsummer.tistory.com

 

3. oh my zsh

sudo apt-get install zsh #zsh 설치
chsh -s /usr/bin/zsh #zsh 기본 경로 셀 지정
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" #oh-my-zsh 설치

 

테마 변경

https://github.com/ohmyzsh/ohmyzsh?tab=readme-ov-file#themes

 

GitHub - ohmyzsh/ohmyzsh: 🙃 A delightful community-driven (with 2,300+ contributors) framework for managing your zsh config

🙃 A delightful community-driven (with 2,300+ contributors) framework for managing your zsh configuration. Includes 300+ optional plugins (rails, git, macOS, hub, docker, homebrew, node, php, pyth...

github.com

폰트 설치

https://github.com/naver/d2codingfont

 

GitHub - naver/d2codingfont: D2 Coding 글꼴

D2 Coding 글꼴. Contribute to naver/d2codingfont development by creating an account on GitHub.

github.com

프롬프터 변경

https://jjam89.tistory.com/180

 

[SHELL]oh-my-zsh의 agnoster 테마 프롬프트 변경하기

목차 ```~/.oh-my-zsh/themes/agnoster.zsh-theme`` 파일 열기(vim) prompt_dir(), prompt_context() 변경하기. 전체 경로를 현재 위치만으로 설정하기 ~/Documents/testFile -> testFile 기존에 있는 텍스트 파일을 # Dir: current wor

jjam89.tistory.com

prompt_context() {
if [[ "$USER" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then

emojis=("🐾" "🦖" "🐢" "🐬" "🐡" "🍀" "🔥" "👾" "🦄" "🌈" "🚀" "💡" "🔑" "🌙" "⚽" "⚡")
D_EMOJI=$((RANDOM%=${#emojis[@]} - 1))

prompt_segment black default "${emojis[$D_EMOJI]}"
fi
}

 

4. figlet

sudo apt install figlet
vi ~/.zshrc
figlet "oddsummer56"

 

5. pyenv

curl https://pyenv.run | bash

$ tail -n 3 ~/.zshrc
export PYENV_ROOT="$HOME/.pyenv"
[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"

$ pyenv
pyenv 2.4.7
Usage: pyenv <command> [<args>]
sudo apt update; sudo apt install build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev curl git \
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev
pyenv install --list
pyenv install 3.11.9

 

6. airflow

#가상환경 생성
pyenv virtualenv 3.11.9 air

#가상환경 실행
pyenv activate
#pyenv global air

#.zshrc 
export AIRFLOW_HOME=~/airflow
alias airs="airflow standalone"
AIRFLOW_VERSION=2.9.3

# Extract the version of Python you have installed. If you're currently using a Python version that is not supported by Airflow, you may want to set this manually.
# See above for supported versions.
PYTHON_VERSION="$(python -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")')"

CONSTRAINT_URL="https://raw.githubusercontent.com/apache/airflow/constraints-${AIRFLOW_VERSION}/constraints-${PYTHON_VERSION}.txt"
# For example this would install 2.9.3 with python 3.8: https://raw.githubusercontent.com/apache/airflow/constraints-2.9.3/constraints-3.8.txt

pip install "apache-airflow==${AIRFLOW_VERSION}" --constraint "${CONSTRAINT_URL}"
pip3 install virtualenv