2023. 9. 1. 09:01ㆍ웹/백엔드-python
프로젝트를 진행하다 보면 여러 모듈을 사용하는데, 각 모듈은 서로 의존성을 가지고 있어 관리하기가 어렵다.
예를 들어 A프로젝트는 (a(1.1버전),b) 모듈을 사용하는데, B 프로젝트는 (a(1,2버전),b)를 사용한다면 a의 버전이 벌써 다르기 때문에 둘 다 전역적으로 설치하여 사용할 수 없다.
각각의 필요한 모듈을 별도의 로컬 환경에 설치하여 사용하게 되는데 이를 가상환경이라고 한다.
node.js의 npm 모듈과 같원리이다.
node.js는 npm으로 설치하는데 npm은 자동으로 로컬 환경에 모듈을 설치하지만, python이 사용하는 pip는 글로벌 환경에 설치한다. 이 때문에 별도로 가상환경이라는 개념을 적용하게 된다.
초기에는 파이썬는 가상환경을 지원해주지 않아 여러 가지 표준/비표준 라이브러리가 존재했다.
파이썬 가상환경 설치
파이썬이 관리하는 표준 라이브러니는 설치가 필요없지만 지원하지 않는 비표준은 설치가 필요하다.
여기서는 miniconda를 설치한다. 아래 홈페이지에 설치방법이 있다.
https://docs.conda.io/projects/miniconda/en/latest/
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh
# 터미널 창 다시 오픈 후
conda list
checksum 참조 사이트
https://jjeongil.tistory.com/1571
윈도우 우분투환경에서 개발환경 구성하기
터미널 색상 변경 프로그램
https://github.com/Gogh-Co/Gogh#-themes
깃 설치하기
sudo apt update
sudo apt install git
git --version
git config --global user.name [your git name]
git config --global user.email [your git email]
깃 관련 터미널 툴들
TIG
깃 커밋 히스토리를 터미널에서 보여 주는 툴
git log와 동일한 기능이지만 훨씬 보기 쉽게 해준다.
자세한건 tig의 깃허브 페이지에서 확인할 수 있다.
TIG manual번역판
https://ujuc.github.io/2016/02/10/tig-manual/
sudo apt -y install tig
Diff SO Fancy
git diff의 출력 화면을 터미널상에서 더 보기 쉽해 출력해주는 깃 플러그인이다.
git diff의 출력 화면은 보기 어려울 수 있는데 이 플러그인은 수정 사항들이 눈에 더 잘 들어온다.
https://github.com/so-fancy/diff-so-fancy
sudo apt update
sudo apt install npm
sudo npm -g install diff-so-fancy
셸
커널과 사용자의 유저 스페이스를 이어 주는 인터페이스 역할 프로그램.
bash보다 편한 zsh 설치하기
sudo apt install zsh -y
# 디폴트 셸을 bash에서 zsh로 변경
chsh -s `which zsh`
# zsh 경로가 나오면 zsh이 디폴트 셸로 설정된 것.
echo $SHELL
'웹 > 백엔드-python' 카테고리의 다른 글
insert 연습 (0) | 2023.09.05 |
---|---|
Role과 사용자 만들기 / select 연습 (0) | 2023.09.05 |
sql - 1일차 - 오후 (0) | 2023.09.04 |
sql - 1일차 -오전 (0) | 2023.09.04 |
파이썬 가상환경 (0) | 2023.09.03 |