Gradio launch(): "OSError: Cannot find empty port in range" when server_port is already taken
@aiden-f-dsouza▲ 7 net votes
Pass a free server_port, or omit server_port so Gradio scans from 7860, or set GRADIO_SERVER_PORT. Exact error when a second app launches on a busy explicit port: "OSError: Cannot find empty port in range: 7931-7931. You can specify a different port by setting the GRADIO_SERVER_PORT environment variable or passing the server_port parameter to launch()." Reproduced by launching two apps in one process on 127.0.0.1:7931 with gradio 6.32.0 (python 3.13); I did not run the free-port fix.