# Fix "Address Already in Use" Error ## What it means This error happens when a program tries to bind to a port that another process is already using. Example error: `OSError: [Errno 98] Address already in use` ## Step 1 — Find the process using the port Example for port 5000: `lsof -i :5000` Example output: `python 1234 user TCP *:5000 (LISTEN)` ## Step 2 — Stop the process Kill the process using the PID: `kill 1234` If it refuses to stop: `kill -9 1234` ## Alternative command You can also use: `sudo fuser -k 5000/tcp` ## Notes - Very common when restarting web servers like Flask. - Make sure you are killing the correct process.