[Python] Port 5000 already in use | MacOS 사용 시 에러

LeeSeungEun·2023년 5월 24일
0

Python

목록 보기
3/4

1. error

  • visual studio code에서 flask 실행 시 발생함
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.

2. solution

  • Mac os 가 사용하고 있는 5000 port 끊기
    Step 1.
    특정 포트번호를 사용 중인 PID를 확인한다. 참고로 PID는 process_id 의 축약어이다.

    lsof -n -i TCP:5000

    그럼 아래에 사용중인 프로세스와 PID값이 나온다.

    COMMAND      PID 
    ControlCe   12345(사용자에 따라 다름)
    

    Step 2

    . kill -9 pid 값 명령어를 통해 연결 중인 프로세스를 끊어준다.

    kill -9 (12345)

0개의 댓글

관련 채용 정보