porttaipy

In Taipy, error: “ConnectionError: Port 5000 is already opened on 127.0.0.1. You have another server application running on the same port.”


When trying to run my code, I get this error:

ConnectionError: Port 5000 is already opened on 127.0.0.1. 
You have another server application running on the same port.

Does anyone know what should be the solution?


Solution

  • You already have an application that runs using port 5000 and your current application attempts to use the same port. The first option that you have is to find out what is running and using your port and change that. This is very much dependent on your operating system which you did not mention. If you need further instructions on that, you will need to provide your OS as well.

    Your second and possibly more convenient option is to change the port Taipy will use. See https://docs.taipy.io/en/release-1.0/manuals/gui/configuration/

    port (int, default: 5000): the port that the server uses

    Gui.run() has the declaration of

    run(self, run_server=True, run_in_thread=False, **kwargs)
    

    and if you read more, you will see this about kwargs:

    Additional keywords that configure how this Gui is run. Please refer to the Configuration section in the User Manual for more information.

    I am not a Taipy expert to put it mildly, but I found this example where a different port is being set:

    gui = Gui(gender_line)
    gui.run(dark_mode=False, port=5001)
    

    here: https://nphchi223.medium.com/suicide-rate-analysis-interactive-dashboard-with-taipy-in-2-hours-36ab38e499d0

    Apparently the parameters that you pass are comma-separated and you can specify port to be equal to a number