Yes obviously I run the command:
killall -9 python
But not working again same error
Error: That port is already in use.
Well, I can also use other port like 8001 instead of 8000 and BOOM!, but please explain why this happens ?
This happens because you didn't closed that port properly and the connection/port is still running in the background. (Maybe you exited by pressing ctrl+z instead of ctrl+c) You can use this to kill that process:
sudo fuser -k 8000/tcp
Note: 8000 is the port number.