Python Virtual Environment
Last updated
Was this helpful?
Last updated
Was this helpful?
Ref:
To create an isolated environment for different Python projects
You can install a specific version of the module on each project without worrying that it will affect your other Python projects.
Check your python version
Python 2 ๊น์ง๋ ์ธ๋ถํจํค์ง๋ฅผ ํตํด ์ค์นํ์ง๋ง Python 3 ๋ถํฐ๋ venv ๋ชจ๋์ด ๋ด์ฅ๋์ด ์๊ธฐ ๋๋ฌธ์ ๋ฐ๋ก ์ค์นํ ํ์ ์์ต๋๋ค. ๋ง์ฝ Python 2 ๋ผ๋ฉด ์๋ ๋ช ๋ น์ ํตํด ํจํค์ง๋ฅผ ์ค์นํฉ๋๋ค.
Create a virtual environment
git ignore
๊ฐ์ ํ๊ฒฝ์ ๊ตณ์ด Git๊ณผ ๊ฐ์ ์์ค ๋ฒ์ ๊ด๋ฆฌ ์์คํ ์ ์ฌ๋ฆด ํ์๋ ์์ผ๋ฏ๋ก
.venv
๋๋ ํ ๋ฆฌ๋ฅผ.gitignore
ํ์ผ์ ์ถ๊ฐ
activate your virtual environment
set up command alias in .bashrc
ํ์ด์ฌ๋ฒ์ ์ ๋ฐ๋ผ์ ์์ฑ๋ activate ํ์ผ์ ํ์ฅ์๊ฐ .bat ์ผ ์ ์๋ค.
.bat ํ์ผ์ powershell ์ด๋ bash ์์ ์คํ๋์ง ์๊ณ cmd์์๋ง ์๋ํ๋ค.