EXTERNAL: OSError: [Errno 48] Address already in use

Cameron Simpson cs at cskk.id.au
Fri Jun 29 18:59:55 EDT 2018


On 29Jun2018 09:50, Jim Lee <jlee54 at gmail.com> wrote:
>On 06/29/18 08:05, T Berger wrote:
>>On Friday, June 29, 2018 at 10:45:10 AM UTC-4, T Berger wrote:
>>>On Thursday, June 28, 2018 at 1:21:32 AM UTC-4, T Berger wrote:
>>>I have to backtrack on my optimistic pronouncement. I know why I'm getting 
>>>"address already in use" error messages, but I don't know how to avoid 
>>>getting them. The problem is that I'm working with both IDLE  and my 
>>>Terminal at the same time. I have to close out of IDLE in some decisive way 
>>>so that the connection with the port is cut. Otherwise I will get the error 
>>>message. At first, just restarting the shell in IDLE worked. Then I actually 
>>>had to close the app (which didn't seem like a flexible option to me). Now, 
>>>even quitting out of IDLE doesn't work. So my revised question is: How do I 
>>>work with both apps together so these error messages don't keep recurring?
>
>>Addendum
>>I'm using the flask test web address http://127.0.0.1:5000/ for both IDLE and 
>>Terminal.
>
>That's not a "web address" - it's the address of your own machine. In 
>other words, you're connecting to yourself.  You can't use it 
>simultaneously for both applications - you'll need to change the port number 
>to something other than 5000 in one of them.

The key point here from Jim is "simultaneously". Are you properly shutting down 
the Flask instance in IDLE before running from Terminal, and vice versa?

Otherwise both will try to use the same local port and There Can Be Only One.

Do you need to run from both environments at the same time? I'd have thought 
not, which also leads me to: why are you flicking from IDLE to Terminal? I 
would have imagined using one or the other normally, not both. It isn't wrong 
to use both, just surprising.

Cheers,
Cameron Simpson <cs at cskk.id.au>



More information about the Python-list mailing list