I'm making a python application with eel and ran into an issue when I tried to run multiple instances of application. The error message is:
OSError: [WinError 10048] Only one usage of each socket address (protocol/network address/port) is normally permitted: ('localhost', 8000)
Is there a way to be able to run multiple instances of the same application on the same machine without an issue? I saw this StackOverflow question which seemed to be similar. Can I fix this? Since it's on a localhost server, the port would need to be changed to allow for both to work, right? (I need then to be completely sperate so simply opening new localhost:8000 window wouldn't work).
Having the same thing here but while running only one instance of the window, also when the window opens it displays this: Error: 500 Internal Server Error.

Maybe it has to do with the href's on a file or on the include?, this really seems strange.
Could the localhost:8000 be used by another program that you have running somewhere? (Look at https://stackoverflow.com/questions/48198/how-can-you-find-out-which-process-is-listening-on-a-port-on-windows to see how to do that)
Hi @FutureLights. If you use eel.start(port=8001), for example, for the second instance of the application you run, then you should no longer have the port conflict.
Without seeing your code I can't provide a concrete code sample to get you going, but I suspect you will want to provide a command-line argument to your script that accepts a port number, and pass this through to eel above, so that you can then run multiple versions of your script and define the port at-will. Eg:
./run_my_eel.py --port 8000
./run_my_eel.py --port 8001
Does this help?
If it is not mandotory to always run your app at port: 8000, then what you could also do is pass {'port': 0} as an option to eel at the time of startup. Then the os will figure out an available port and assign it to that particular instance. Then the user can open x number of instances of your app without any issue.
Thanks, I'll definitely be using that.
Hi @FutureLights. If you use
eel.start(port=8001), for example, for the second instance of the application you run, then you should no longer have the port conflict.Without seeing your code I can't provide a concrete code sample to get you going, but I suspect you will want to provide a command-line argument to your script that accepts a port number, and pass this through to eel above, so that you can then run multiple versions of your script and define the port at-will. Eg:
./run_my_eel.py --port 8000 ./run_my_eel.py --port 8001Does this help?
This fixed it, ty
Most helpful comment
Hi @FutureLights. If you use
eel.start(port=8001), for example, for the second instance of the application you run, then you should no longer have the port conflict.Without seeing your code I can't provide a concrete code sample to get you going, but I suspect you will want to provide a command-line argument to your script that accepts a port number, and pass this through to eel above, so that you can then run multiple versions of your script and define the port at-will. Eg:
Does this help?