[Flask] Port 5000 is already in use
728x90

 

 

์–ด๋–ค ์—๋Ÿฌ?

Flask ์„œ๋ฒ„ ํŒจํ‚ค์ง€๋ฅผ ์„ค์น˜ํ•˜๊ณ  ์„œ๋ฒ„๋ฅผ ์‹คํ–‰ํ•˜๋‹ˆ ์—๋Ÿฌ ๋ฉ”์‹œ์ง€ ๋“ฑ์žฅ~ ๐Ÿ˜‡

Address already in use
Port 5000 is in use by another program. Either identify and stop that program, or start the server with a different port.
On macOS, try disabling the 'AirPlay Receiver' service from System Preferences -> Sharing.

์ฝ์–ด๋ณด๋ฉด ๋Œ€๋žต ํฌํŠธ 5000๋ฒˆ์ด ์ด๋ฏธ ์‚ฌ์šฉ๋˜๊ณ  ์žˆ์–ด์„œ ์„œ๋ฒ„๋ฅผ ์‹คํ–‰์‹œํ‚ฌ ์ˆ˜ ์—†๋‹ค๋Š” ๋‚ด์šฉ์ด๋‹ค.

๋‚˜๋Š” ๋งฅ๋ถ ์œ ์ €์ธ๋ฐ OS๊ฐ€ ๋ชฌํ…Œ๋ ˆ์ด๋กœ ์—…๊ทธ๋ ˆ์ด๋“œ๋œ ์ดํ›„ ํฌํŠธ 5000๋ฒˆ์ด ์“ฐ์ด๊ณ  ์žˆ๋Š” ๋ชจ์–‘์ด๋‹ค.

์—๋Ÿฌ ๋ฉ”์‹œ์ง€์—์„œ ํ•ด๊ฒฐ๋ฐฉ๋ฒ•๋„ ์ œ์‹œํ•ด์ฃผ๋‹ˆ ๊ทธ๋Œ€๋กœ ํ•ด๋ณด์ž!

 

 

ํ•ด๊ฒฐ

์„ค์ • > ๊ณต์œ  ์—์„œ Airplay๋ฅผ ๊บผ๋ณด๋Š” ๋ฐฉ๋ฒ•! AirPlay ์ˆ˜์‹  ๋ชจ๋“œ๊ฐ€ ์ฒดํฌ๋˜์–ด ์žˆ๋‹ค๋ฉด ํ•ด์ œํ•˜๋ฉด ๋œ๋‹ค.

ํ˜„์žฌ๋Š” ์ฒดํฌ ํ•ด์ œ ์ƒํƒœ

 

๋‹ค์‹œ ์‹คํ–‰ํ•ด๋ณด๋ฉด ์„œ๋ฒ„๊ฐ€ ์ž˜ ๋™์ž‘ํ•˜๋Š” ๊ฒƒ ํ™•์ธ!

 

 

์ด ๋ฐฉ๋ฒ•์ด ์•ˆ๋œ๋‹ค๋ฉด, ํ„ฐ๋ฏธ๋„์„ ์—ด์–ด์„œ ํ˜„์žฌ 5000๋ฒˆ ํฌํŠธ๋ฅผ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ๋Š” ํ”„๋กœ์„ธ์Šค๋ฅผ ๊ฐ•์ œ ์ข…๋ฃŒํ•ด๋ฒ„๋ฆฌ๋Š” ๋ฐฉ๋ฒ•์ด ์žˆ๋‹ค.

 

1. ํ˜„์žฌ ์‚ฌ์šฉ์ค‘์ธ ํฌํŠธ์˜ PID๋ฅผ ์ฐพ๊ธฐ

lsof -n -i TCP:[PORT]

 

 

2. ์‚ฌ์šฉ ์ค‘์ธ ํ”„๋กœ์„ธ์Šค ๊ฐ•์ œ ์ข…๋ฃŒํ•˜๊ธฐ

kill -9 [PID]

kill ์˜ต์…˜์ธ -9๋Š” ๊ฐ•์ œ ์ข…๋ฃŒ์ด๊ธฐ ๋•Œ๋ฌธ์— ์ €์žฅ๋˜์ง€ ์•Š์€ ๋ฐ์ดํ„ฐ๋Š” ๋‚ ์•„๊ฐˆ ์ˆ˜ ์žˆ์Œ์„ ์–ธ์ œ๋‚˜ ์ฃผ์˜!..
ํ•˜์ง€๋งŒ ๊ทผ๋ณธ์ ์ธ ์›์ธ์€ Airplay๊ฐ€ ํฌํŠธ๋ฅผ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ๋Š” ๊ฒƒ์ด๊ธฐ ๋•Œ๋ฌธ์— ์ˆ˜์‹ ์„ ๊บผ์ฃผ๋Š” ๊ฒƒ์ด ๊ฐ€์žฅ ๊น”๋”ํ•œ ํ•ด๊ฒฐ์ผ ๋“ฏํ•˜๋‹ค.

 

 

 

์˜ค๋Š˜๋„ ์—๋Ÿฌ ๋ฉ”์‹œ์ง€์˜ ํŒŒ์•…์˜ ์ค‘์š”์„ฑ์„ ๋‹ค์‹œ ํ•œ๋ฒˆ ๊นจ๋‹ฌ์œผ๋ฉฐ.. ์—๋Ÿฌ ํ•ด๊ฒฐ ๋งˆ๋ฌด๋ฆฌ!

728x90