๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
๐Ÿ’ป IT·๊ธฐ์ˆ ·ํ†ต๊ณ„

๋Œ€ํ•™์ƒ ๋•Œ ์•Œ์•˜๋”๋ผ๋ฉด ์ข‹์•˜์„ ํŒŒ์ด์ฌ (0.5 ํŒŒ์ด์ฌ ์„ค์น˜)

by nowgeun 2023. 5. 31.
728x90

 

๋Œ€ํ•™์ƒ ๋•Œ ์•Œ์•˜๋”๋ผ๋ฉด ์ข‹์•˜์„ ํŒŒ์ด์ฌ (์‹œ๋ฆฌ์ฆˆ ์ธ๋„ค์ผ)

 

ํŒŒ์ด์ฌ ์„ค์น˜ (Windows ์šด์˜์ฒด์ œ)

 

1. PC ์‚ฌ์–‘ ํ™•์ธ

Python์„ ์„ค์น˜ํ•˜๊ธฐ์— ์•ž์„œ Window OS ์‚ฌ์šฉ์ž๋“ค์€ ๋ณธ์ธ์˜ PC ์‚ฌ์–‘์„ ํ™•์ธํ•˜์—ฌ์•ผ ํ•ฉ๋‹ˆ๋‹ค. 
PC์‚ฌ์–‘ ํ™•์ธ ๋ฐฉ๋ฒ•์€ ์•„๋ž˜์˜ ์‚ฌ์ง„์„ ๋ณด๊ณ  ๋”ฐ๋ผํ•˜์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค.

(์š”์ฆ˜ ์›ฌ๋งŒํ•œ ์ปดํ“จํ„ฐ๋Š” ์ „๋ถ€ 64bit ๋ผ์„œ ๊ตณ์ด ํ™•์ธ์„ ์•ˆ ํ•˜์…”๋„ ๋ฉ๋‹ˆ๋‹ค...)

 

 

 

์œ„์˜ ๋ฐฉ๋ฒ•์œผ๋กœ ์ž์‹ ์˜ PC ์‚ฌ์–‘์„ ํ™•์ธ ํ•˜์…จ๋‹ค๋ฉด Python ์›น ์‚ฌ์ดํŠธ์—์„œ ๋‹ค์šด๋กœ๋“œ ๋ฐ ์„ค์น˜๋ฅผ ์ง„ํ–‰ํ•˜์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค.

 

2. Python ๋‹ค์šด๋กœ๋“œ

 

ํŒŒ์ด์ฌ์„ ๋‹ค์šด๋กœ๋“œ ํ›„ ์•„๋ž˜์˜ ์‚ฌ์ง„์„ ๋”ฐ๋ผ ์ง„ํ–‰ํ•ด์ฃผ์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค. (https://www.python.org/downloads/)

ํŒŒ์ด์ฌ ๋ฒ„์ „์€ ๋‹ค๋ฅธ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์™€์˜ ํ˜ธํ™˜์„ฑ ๋ฌธ์ œ ๋•Œ๋ฌธ์— ์ตœ์‹  ๋ฒ„์ „๋ณด๋‹ค๋Š” ํ•œ ๋‘ ๋‹จ๊ณ„ ๋‚ฎ์€ ๋ฒ„์ „์„ ์ถ”์ฒœ๋“œ๋ฆฝ๋‹ˆ๋‹ค. 

(3.8. ~ 3.10 ๋ฒ„์ „)

 

(์•„๋ž˜ ๊ทธ๋ฆผ์ฒ˜๋Ÿผ ์„ค์น˜๋ฅผ ์ง„ํ–‰ํ•  ๋•Œ ๊ผญ Add Python 3.XX to PATH ๋ฅผ ํด๋ฆญํ•ด ์ฃผ์„ธ์š”!)

64-bit๋กœ ์„ค์น˜

 

์„ค์น˜๊ฐ€ ์™„๋ฃŒ๋˜์—ˆ๋‹ค๋ฉด ๋ช…๋ น ํ”„๋กฌํ”„ํŠธ์— ์ ‘์†ํ•ด์„œ `python3` ํ˜น์€ `python`์„ ์ž…๋ ฅํ•ด ๋ณด์„ธ์š”.

Python ๋ฒ„์ „๊ณผ ํ•จ๊ป˜ >>> ํ‘œ์‹œ๊ฐ€ ๋‚˜์˜จ๋‹ค๋ฉด ์„ค์น˜๊ฐ€ ๋๋‚ฌ์Šต๋‹ˆ๋‹ค.

์„ค์น˜ ํ™•์ธ

ํŒŒ์ด์ฌ ์„ค์น˜ (Mac ์šด์˜์ฒด์ œ)

 

1. ์„ค์น˜

 

๋งฅ์˜ ๊ฒฝ์šฐ์—๋Š” Python ์„ค์น˜๊ฐ€ ๋งค์šฐ ๊ฐ„๋‹จํ•ฉ๋‹ˆ๋‹ค. ์•„๋ž˜์˜ ํ™”๋ฉด์ฒ˜๋Ÿผ ํ„ฐ๋ฏธ๋„์„ ์šฐ์„  ์ผญ๋‹ˆ๋‹ค.

 

ํ„ฐ๋ฏธ๋„์ด ์œ„์น˜ํ•œ ๊ฒฝ๋กœ

 

๋‹ค์Œ์œผ๋กœ ์•„๋ž˜์˜ ์ฝ”๋“œ๋ฅผ ๊ทธ๋Œ€๋กœ ๋”ฐ๋ผ ์ ์œผ์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค.

 

(ํ•œ ์ค„์”ฉ ๋ณต๋ถ™)

 

xcode-select --install

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

export PATH="/usr/local/opt/python/libexec/bin:$PATH"

brew install python

python

 

 

Jupyter Notebook ์„ค์น˜ (Windows & Mac)

 

ํŒŒ์ด์ฌ์„ ์„ค์น˜ํ•˜๊ณ  ๋‚œ ๋’ค์—๋Š” Jupyter Notebook ์„ค์น˜๋ฅผ ํ•˜๋Š” ๊ฒƒ์„ ๊ถŒ์žฅํ•ฉ๋‹ˆ๋‹ค.

Jupyter Notebook์€ Python์œผ๋กœ ๊ฐœ๋ฐœ ํ…Œ์ŠคํŠธ, ๋ถ„์„, ์ฝ”๋”ฉ ์ž‘์—… ๋ฐ ์ž‘์—…๋ฌผ์„ ๊ณต์œ ํ•  ์ˆ˜ ์žˆ๊ฒŒ๋” ํ•ด์ฃผ๋Š” ํ”„๋กœ๊ทธ๋žจ์ž…๋‹ˆ๋‹ค.

Python์ด ํ•œ๊ธ€์ด๋ผ๋ฉด, Jupyter Notebook์€ ํŽœ๊ณผ ์ข…์ด๋ผ๊ณ  ์ƒ๊ฐํ•˜๋ฉด ๋  ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

 

Jupyter Notebook ์„ค์น˜๋Š” ๋งค์šฐ ๊ฐ„๋‹จํ•ฉ๋‹ˆ๋‹ค.

 

ํ„ฐ๋ฏธ๋„, ๋ช…๋ นํ”„๋กฌํ”„ํŠธ๋ฅผ ์ผ  ๋’ค, ์ฝ”๋“œ ํ•œ ์ค„๋งŒ ์ž…๋ ฅํ•˜๋ฉด ์ž๋™์œผ๋กœ ์„ค์น˜๊ฐ€ ๋ฉ๋‹ˆ๋‹ค:

pip install jupyter

์„ค์น˜๊ฐ€ ๋‹ค ๋๋‚œ ๋’ค์—๋Š” ๋‹ค์Œ ๋ช…๋ น์–ด๋ฅผ ์ž…๋ ฅํ•˜๋ฉด, ์ž๋™์œผ๋กœ Jupyter ํ™ˆ ํ™”๋ฉด์ด ํŒ์—…์œผ๋กœ ๋œน๋‹ˆ๋‹ค.

jupyter notebook

 

Jupyter Notebook์ด ์ผœ์ง„ ๋ชจ์Šต

 `jupyter notebook` ์„ ์ž…๋ ฅํ•œ ๋ช…๋ น ํ”„๋กฌํ”„ํŠธ/ํ„ฐ๋ฏธ๋„์„ ์ข…๋ฃŒํ•˜๋ฉด ์•ˆ ๋ฉ๋‹ˆ๋‹ค!

ํ•ด๋‹น ํ„ฐ๋ฏธ๋„์„ ๋„๊ฒŒ ๋˜๋ฉด jupyter notebook ๋˜ํ•œ ๊ฐ€๋™์ด ์ค‘๋‹จ๋ฉ๋‹ˆ๋‹ค.

๋ฐ˜์‘ํ˜•

๋Œ“๊ธ€