EXTERNAL: OSError: [Errno 48] Address already in use
brgrt2 at gmail.com
Mon Jul 2 13:51:28 EDT 2018
On Monday, July 2, 2018 at 1:22:59 PM UTC-4, T Berger wrote:
> On Saturday, June 30, 2018 at 6:02:06 PM UTC-4, T Berger wrote:
> > On Friday, June 29, 2018 at 7:00:15 PM UTC-4, Cameron Simpson wrote:
> > > 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?
> > Cameron, I try every option to quit either program, but they don't work. Or I should say, they mostly don't work. Once in a while they do. The one option which works (which is not a feasible option) is rebooting my Mac (actually that might not work either. I think I got the error message again this morning when I rebooted).
> > > 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.
> > I'm working from a Python manual. I created the webapp in IDLE, and test it in Terminal, per the instructions in the manual. I use IDLE to edit my program, and then test it in terminal. When I go from one to the other, I get the error message. IDLE has a keyboard shortcut for quitting the shell—Cntl + C—but it doesn't work. Neither does restarting the shell. Neither does entering the kill command line, not in IDLE or terminal.
> > Do you have any other suggestions? I'm going to email the writer. He doesn't mention how to deal with problems that might arise from working with two programs at the same time. Maybe Cntl+C should do it, but in my case it doesn't.
> > Tamara
> Cameron, I'd like to add screenshots of my idle and terminal windows. Perhaps this would shed light on my this issue.
> This is my last window in terminal:
> [Restored Jul 2, 2018, 1:12:09 PM]
> Last login: Mon Jul 2 10:58:54 on ttys000
> Restored session: Mon Jul 2 11:04:19 EDT 2018
> 192:Webapp TamaraB$ exit
> Saving session...
> ...saving history...truncating history files...
> [Process completed]
> To me this looks like the program running in terminal has been killed.
> Now this is my idle shell:
> RESTART: /Users/TamaraB/Desktop/Webapp/vsearch4web.py
> * Serving Flask app "vsearch4web" (lazy loading)
> * Environment: production
> [31m WARNING: Do not use the development server in a production environment. [0m
> [2m Use a production WSGI server instead. [0m
> * Debug mode: on
> Traceback (most recent call last):
> File "/Users/TamaraB/Desktop/Webapp/vsearch4web.py", line 26, in <module>
> File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/flask/app.py", line 943, in run
> run_simple(host, port, self, **options)
> File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/werkzeug/serving.py", line 795, in run_simple
> s.bind(get_sockaddr(hostname, port, address_family))
> OSError: [Errno 48] Address already in use
> Why should there be an error in idle? It's the only app running.
> I emailed the writer of the manual I'm using, but who knows if, or when, he'll reply. So any help you provide would be great.
I forgot to add that I get the error message even after I exit from idle. Exiting from idle is supposed to kill the running program. That is what the the confirming dialog box explicitly states.
More information about the Python-list