Computer Science/๊ธฐํƒ€

ํŒŒ์ด์ฌ ๊ฐ€์ƒํ™˜๊ฒฝ ๋งŒ๋“ค๊ธฐ (python)

_cactus 2021. 3. 5. 16:10
๋ฐ˜์‘ํ˜•

#python ๊ฐ€์ƒํ™˜๊ฒฝ ๋งŒ๋“ค๊ธฐ
#๊ฐ€์ƒํ™˜๊ฒฝ์— jupyter notebook์„ค์น˜
#ํŒŒ์ด์ฌ ๊ฐ€์ƒํ™˜๊ฒฝ์— ์ฅฌํ”ผํ„ฐ๋…ธํŠธ๋ถ ์„ค์น˜

1. ๊ฐ€์ƒํ™˜๊ฒฝ ๋งŒ๋“ค๊ธฐ

python3 -m venv ๊ฐ€์ƒํ™˜๊ฒฝ_์ด๋ฆ„

 

2. ๊ฐ€์ƒํ™˜๊ฒฝ ํ™œ์„ฑํ™”

source ๊ฐ€์ƒํ™˜๊ฒฝ_์ด๋ฆ„/bin/activate

 

 

pip ๋กœ ํŒจํ‚ค์ง€ ๊ด€๋ฆฌ

  • pip ๋ผ๋Š” ํ”„๋กœ๊ทธ๋žจ์„ ์‚ฌ์šฉํ•˜์—ฌ ํŒจํ‚ค์ง€๋ฅผ ์„ค์น˜, ์—…๊ทธ๋ ˆ์ด๋“œ ๋ฐ ์ œ๊ฑฐํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

  • pip ๋Š” "search", "install", "uninstall", "freeze" ๋“ฑ ๋งŽ์€ ๋ถ€์† ๋ช…๋ น์„ ๊ฐ–๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค

 

์ฐธ๊ณ  :

https://docs.python.org/ko/3/tutorial/venv.html

 

 

jupyter notebook ์— ๊ฐ€์ƒํ™˜๊ฒฝ ์ถ”๊ฐ€

(์ฐธ๊ณ ) https://medium.com/@5eo1ab/jupyter-notebook์—-๊ฐ€์ƒํ™˜๊ฒฝ-kernel-์ถ”๊ฐ€ํ•˜๊ธฐ-ed5261a7e0e6

 

1. ๊ฐ€์ƒํ™˜๊ฒฝ ํ™œ์„ฑํ™”

source activate [virtualEnv]

 

2. ๊ฐ€์ƒํ™˜๊ฒฝ์—์„œ jupyter notebook ์„ค์น˜

pip install ipykernel

 

3. jupyter notebook์—์„œ ๊ฐ€์ƒํ™˜๊ฒฝ kernel ์ถ”๊ฐ€

python -m ipykernel install --user --name [virtualEnv] --display-name โ€œ[displayKernelName]"

 

 

 

 

โ€”> ์—ฌ๊ธฐ์— [displayKernelName] ์ด๋ฆ„์œผ๋กœ ๋œ ๊ฐ€์ƒํ™˜๊ฒฝ์ด ์ถ”๊ฐ€๋จ

 

 

 

728x90
๋ฐ˜์‘ํ˜•