One reason for this error might be an external process, which is already using this port. If you can determine which process exactly is causing this issue, you may be able to change its settings to use a different port. If not, or if it does not have settings, any computer-wide setting to block programs from using 11311 would also block ROS.
Port 11311 is the default port for ROS, but you can use any other port, as long as your other ROS machines target it, as shown in the example below
core = ros.Core(11312);