Help with "OSError: Cannot find empty port in range: 7860-7860"

I am trying to deploy an app using Gradio SDK but I keep getting the following error: OSError: Cannot find empty port in range: 7860-7860. You can specify a different port by setting the GRADIO_SERVER_PORT environment variable or passing the server_port parameter to launch().

There is a similar post that covered the same issue: All ports in use - Beginners - Hugging Face Forums. But it was not helpful because the OP chose the wrong SDK. I deleted and created a new space to double check that I selected the Gradio SDK and I am still facing the same issue.

Other things I have tried:

  • Restarting space
  • Factory rebuild
  • Tried other ports (7861, 7862, etc.)

None have worked and I am at a loss on how to resolve this.

2 Likes

Hello, I am also facing a similar issue. Do you have a thorough solution?

app_port : int
Port on which your application is running. Used only if sdk is docker. Default port is 7860.

Can’t we do something with this?

Make sure to change the sdk in your README to gradio (and the required sdk_version).

1 Like