๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
IT-Engineering/Python

Visual Studio Code ํŒŒ์ด์ฌ ์ธํ„ฐํ”„๋ฆฌํ„ฐ ๊ฒฝ๋กœ ๋ณ€๊ฒฝ

by ๐Ÿงž‍โ™‚๏ธ 2020. 3. 15.
๋ฐ˜์‘ํ˜•

Visual Studio Code ํŒŒ์ด์ฌ(Python) ์ธํ„ฐํ”„๋ฆฌํ„ฐ(Interpreter) ๊ฒฝ๋กœ ๋ณ€๊ฒฝ

Visual Studio Code์—์„œ ์ž‘์—…์„ ํ•˜๋‹ค๋ณด๋ฉด Python ๋ฒ„์ „์„ ๋งž์ถ”๊ธฐ ์œ„ํ•ด ๊ฒฝ๋กœ ๋ณ€๊ฒฝ์ด ํ•„์š”ํ•  ๋•Œ๊ฐ€ ์žˆ๋‹ค.

์ด๋ฅผํ…Œ๋ฉด Python2.x๋ฒ„์ „์„ ์‚ฌ์šฉํ•˜๋‹ค๊ฐ€ Python3.x๋ฒ„์ „์„ ์‚ฌ์šฉํ•˜๋Š” ๊ฒฝ์šฐ,

ํ˜น์€ Anacondaํ™˜๊ฒฝ์˜ Python์„ ์‚ฌ์šฉํ•˜๋Š” ๊ฒฝ์šฐ ๋“ฑ์ด ๊ทธ๋Ÿด ๊ฒƒ์ด๋‹ค.

 

1. F1 ๋˜๋Š” Ctrl + Shift + P ์ž…๋ ฅ(Palette ๋ช…๋ น)

2. Python Interpreter๋ฅผ ์ž…๋ ฅํ•˜์—ฌ "Python: Select Interpreter" ํด๋ฆญ

3. ์›ํ•˜๋Š” Python Interpreter๋ฅผ ์‚ฌ์šฉ

์ด๋ ‡๊ฒŒ ๋˜๋ฉด settings.jsonํŒŒ์ผ์ด ์ƒ์„ฑ ํ˜น์€ ๋ณ€๊ฒฝ๋˜์–ด Python interpreter์˜ ๊ฒฝ๋กœ๋ฅผ ์ง€์ •ํ•ด์ฃผ๊ฒŒ ๋œ๋‹ค.

์•„๋ž˜์˜ ๋‘ ๋งํฌ๋ฅผ ์ฐธ์กฐํ•˜๋ฉด Visual Studio Code๊ฐ€ ์–ด๋–ค ๋ฐฉ์‹์œผ๋กœ Python ๊ฐœ๋ฐœ ํ™˜๊ฒฝ์„ ๊ด€๋ฆฌํ•˜๋Š”์ง€ ์•Œ์•„๋ณผ ์ˆ˜ ์žˆ๋‹ค.

https://code.visualstudio.com/docs/python/environments

 

Using Python Environments in Visual Studio Code

Configuring Python Environments in Visual Studio Code

code.visualstudio.com

Interpreter๋ฅผ ์ž๋™์œผ๋กœ ์ฐพ์•„์ฃผ๋Š” ๋ถ€๋ถ„๋„ ๋งค์šฐ ํฅ๋ฏธ๋กญ๋‹ค.

https://code.visualstudio.com/docs/python/environments#_where-the-extension-looks-for-environments

 

Using Python Environments in Visual Studio Code

Configuring Python Environments in Visual Studio Code

code.visualstudio.com

 

๋ฐ˜์‘ํ˜•

๋Œ“๊ธ€