Python Socket.error Errno 48 Address Already In Use
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring error: [errno 98] address already in use odoo developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question return getattr(self._sock,name)(*args) socket.error: [errno 98] address already in use x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; oserror: [errno 98] address already in use flask it only takes a minute: Sign up socket.error: [Errno 48] Address already in use up vote 61 down vote favorite 34 I'm trying to set up a server with python from mac terminal. I navigate to folder location an use: socket 'address already in use' python -m SimpleHTTPServer But this gives me error: socket.error: [Errno 48] Address already in use I had previously open a connection using the same command for a different website in a different location in my machine. python simplehttpserver share|improve this question edited Feb 18 '15 at 0:19 asked Sep 28 '13 at 20:48 irm 49531225 1 Kill the other process or run this one with a different port: python -m SimpleHTTPServer 8081 –Blender Sep 28 '13 at 20:50
Python Close Socket
add a comment| 4 Answers 4 active oldest votes up vote 131 down vote accepted You already have a process bound to the default port (8000). If you already ran the same module before, it is most likely that process still bound to the port. Try and locate the other process first: $ ps -fA | grep python 501 81651 12648 0 9:53PM ttys000 0:00.16 python -m SimpleHTTPServer The command arguments are included, so you can spot the one running SimpleHTTPServer if more than one python process is active. You may want to test if http://localhost:8000/ still shows a directory listing for local files. The second number is the process number; stop the server by sending it a signal: kill 81651 Alternatively, run the server on a different port, by specifying the alternative port on the command line: $ python -m SimpleHTTPServer 8910 Serving HTTP on 0.0.0.0 port 8910 ... then access the server as http://localhost:8910; where 8910 can be any number from 1024 and up, provided the port is not already taken. share|improve this answer edited Sep 28 '13 at 21:04 answered Sep 28 '13 at 20:54 Martijn Pieters♦ 502k7513181473 What url should I have in browser to see if it is working? I'm running on a different port as you sugested –irm Sep 28 '13 at 21:02 @irm: http://localhost:
here for a quick overview of the site Help Center Detailed answers to any questions you might
Address Already In Use Find Process
have Meta Discuss the workings and policies of this site oserror: [errno 48] address already in use flask About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting return getattr(self._sock,name)(*args) socket.error: [errno 48] address already in use ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 http://stackoverflow.com/questions/19071512/socket-error-errno-48-address-already-in-use million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Need to close python socket / Find the current running server on my dev environment up vote 20 down vote favorite 19 I'm trying to learn python (using the Flask micro-framework) and I am confused because somewhere in http://stackoverflow.com/questions/7703797/need-to-close-python-socket-find-the-current-running-server-on-my-dev-environm my code i'm keeping the server open I believe. I spin up my server with 'python app.py' and then close it however.... it still lives! I'm not sure how this is possible but i must have done something wrong with a connection. There are two questions here really. First: How can I find the active connection/socket and close it Second: Is there a way I can diagnose what is having an open connection, my hunch is that sqlLite is not closing as it is the last thing I implemented. This is a one file application (minus a config file and static content) so I can post the code if required. Error generated (Folder locations changed): /Development/flask_projects/test_email/env/bin/python /Development/flask_projects/test_email/app.py * Running on http://127.0.0.1:5000/ Traceback (most recent call last): File "Development/flask_projects/test_email/app.py", line 58, in
You already have a process bound to the default port (8069). If you already https://didierhm.wordpress.com/2014/08/01/socket-error-errno-48-address-already-in-use/ ran the same module before, it is most likely that process still bound to the port. Try and locate the other process first: $ ps -fA | grep python 501 81651 12648 0 9:53PM ttys000 0:00.16 python -m SimpleHTTPServer The command arguments are included, so you can spot the one address already running SimpleHTTPServer if more than one python process is active. You may want to test if http://localhost:8069/ still shows a directory listing for local files. The second number is the process number; stop the server by sending it a signal: kill -9 81651 Alternatively, run the server on a different port, address already in by specifying the alternative port on the command line: $ python -m SimpleHTTPServer 8970 Serving HTTP on 0.0.0.0 port 8970 … then access the server as http://localhost:8970; where 8970 can be any number from 1024 and up, provided the port is not already taken. Share this:GoogleLinkedInLike this:Like Loading... Related Posted in UncategorizedLeave a comment Post navigation ← Odoo/Openerp Inheritance inviewsRun openerp-gevent odoo manual command linenohup → Leave a Reply Cancel reply Enter your comment here... Fill in your details below or click an icon to log in: Email (required) (Address never made public) Name (required) Website You are commenting using your WordPress.com account. (LogOut/Change) You are commenting using your Twitter account. (LogOut/Change) You are commenting using your Facebook account. (LogOut/Change) You are commenting using your Google+ account. (LogOut/Change) Cancel Connecting to %s Notify me of new comments via email. Create a free website or blog at WordPress.com. %d bloggers like this: