Forums

Time out Port error Cherrypy

(test-web) 20:05 ~ $ python server.py

[03/Nov/2017:20:05:46] ENGINE Listening for SIGHUP.
[03/Nov/2017:20:05:46] ENGINE Listening for SIGTERM.
[03/Nov/2017:20:05:46] ENGINE Listening for SIGUSR1.
[03/Nov/2017:20:05:46] ENGINE Bus STARTING
[03/Nov/2017:20:05:46] ENGINE Started monitor thread 'Autoreloader'.
[03/Nov/2017:20:05:46] ENGINE Started monitor thread '_TimeoutMonitor'.
[03/Nov/2017:20:05:47] ENGINE Error in 'start' listener <bound method Server.start of <cherrypy._cpserver.Server object at 0x7f806f64e110>>
Traceback (most recent call last):
File "/home/User/.virtualenvs/test-web/local/lib/python2.7/site-packages/cherrypy/process/wspbus.py", line 216, in publish
output.append(listener(args, kwargs))
File "/home/User/.virtualenvs/test-web/local/lib/python2.7/site-packages/cherrypy/_cpserver.py", line 173, in start
super(Server, self).start()
File "/home/User/.virtualenvs/test-web/local/lib/python2.7/site-packages/cherrypy/process/servers.py", line 177, in start
portend.free(
self.bind_addr, timeout=Timeouts.free)
File "/home/User/.virtualenvs/test-web/local/lib/python2.7/site-packages/portend.py", line 119, in free
raise Timeout("Port {port} not free on {host}.".format(**locals()))
Timeout: Port 80 not free on 0.0.0.0.

[03/Nov/2017:20:05:47] ENGINE Shutting down due to error in start listener:
Traceback (most recent call last):
File "/home/User/.virtualenvs/test-web/local/lib/python2.7/site-packages/cherrypy/process/wspbus.py", line 254, in start
self.publish('start')
File "/home/User/.virtualenvs/test-web/local/lib/python2.7/site-packages/cherrypy/process/wspbus.py", line 234, in publish
raise exc
ChannelFailures: Timeout('Port 80 not free on 0.0.0.0.',)

[03/Nov/2017:20:05:47] ENGINE Bus STOPPING
[03/Nov/2017:20:05:47] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 80)) already shut down
[03/Nov/2017:20:05:47] ENGINE Stopped thread '_TimeoutMonitor'.
[03/Nov/2017:20:05:47] ENGINE Stopped thread 'Autoreloader'.
[03/Nov/2017:20:05:47] ENGINE Bus STOPPED
[03/Nov/2017:20:05:47] ENGINE Bus EXITING
[03/Nov/2017:20:05:47] ENGINE Bus EXITED

Not sure how to fix this any suggestions?

To run a web server on PythonAnywhere, you need to set it up on the "Web" tab rather than run it in a console; check out this help page with instructions specifically for CherryPy.