pikaraoke icon indicating copy to clipboard operation
pikaraoke copied to clipboard

pygame having errors on macos

Open AaronMeyers opened this issue 2 years ago • 1 comments

i'm having a little bit of a pikaraoke emergency! people are on their way over for karaoke and it's not working... when i run it, i get this:

`aaron@Aarons-MacBook-Pro pikaraoke % cd ../pikaraoke2 aaron@Aarons-MacBook-Pro pikaraoke2 % python3 app.py
pygame 2.1.0 (SDL 2.0.16, Python 3.10.8) Hello from the pygame community. https://www.pygame.org/contribute.html [2022-10-14 19:34:36] INFO: Fetching available songs in: /Users/aaron/pikaraoke-songs/ [2022-10-14 19:34:36] INFO: VLC command base: /Applications/VLC.app/Contents/MacOS/VLC -f --play-and-exit --extraintf http --http-port 5002 --http-password vkIN9SIVuqOtu3A3fVsfPjAWqKhmpKfN --no-embedded-video --no-keyboard-events --no-mouse-events --mouse-hide-timeout 0 --video-on-top --no-video-title --mouse-hide-timeout 0 --no-macosx-show-playback-buttons --no-macosx-show-playmode-buttons --no-macosx-interfacestyle --macosx-nativefullscreenmode --macosx-continue-playback 0 [14/Oct/2022:19:34:37] ENGINE Bus STARTING [2022-10-14 19:34:37] INFO: [14/Oct/2022:19:34:37] ENGINE Bus STARTING [14/Oct/2022:19:34:37] ENGINE Started monitor thread '_TimeoutMonitor'. [2022-10-14 19:34:37] INFO: [14/Oct/2022:19:34:37] ENGINE Started monitor thread '_TimeoutMonitor'. [14/Oct/2022:19:34:38] ENGINE Error in 'start' listener <bound method Server.start of <cherrypy._cpserver.Server object at 0x1023771f0>> Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/portend.py", line 122, in free Checker(timeout=0.1).assert_free(host, port) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/portend.py", line 71, in assert_free list(itertools.starmap(self._connect, info)) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/portend.py", line 87, in _connect raise PortNotFree(tmpl.format(**locals())) portend.PortNotFree: Port 5000 is in use on 0.0.0.0.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/cherrypy/process/wspbus.py", line 215, in publish output.append(listener(*args, **kwargs)) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/cherrypy/_cpserver.py", line 168, in start super(Server, self).start() File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/cherrypy/process/servers.py", line 177, in start portend.free(*self.bind_addr, timeout=Timeouts.free) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/portend.py", line 126, in free raise Timeout("Port {port} not free on {host}.".format(**locals())) portend.Timeout: Port 5000 not free on 0.0.0.0.

[2022-10-14 19:34:38] ERROR: [14/Oct/2022:19:34:38] ENGINE Error in 'start' listener <bound method Server.start of <cherrypy._cpserver.Server object at 0x1023771f0>> Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/portend.py", line 122, in free Checker(timeout=0.1).assert_free(host, port) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/portend.py", line 71, in assert_free list(itertools.starmap(self._connect, info)) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/portend.py", line 87, in _connect raise PortNotFree(tmpl.format(**locals())) portend.PortNotFree: Port 5000 is in use on 0.0.0.0.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/cherrypy/process/wspbus.py", line 215, in publish output.append(listener(*args, **kwargs)) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/cherrypy/_cpserver.py", line 168, in start super(Server, self).start() File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/cherrypy/process/servers.py", line 177, in start portend.free(*self.bind_addr, timeout=Timeouts.free) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/portend.py", line 126, in free raise Timeout("Port {port} not free on {host}.".format(**locals())) portend.Timeout: Port 5000 not free on 0.0.0.0.

[14/Oct/2022:19:34:38] ENGINE Shutting down due to error in start listener: Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/cherrypy/process/wspbus.py", line 253, in start self.publish('start') File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/cherrypy/process/wspbus.py", line 233, in publish raise exc cherrypy.process.wspbus.ChannelFailures: Timeout('Port 5000 not free on 0.0.0.0.')

[2022-10-14 19:34:38] ERROR: [14/Oct/2022:19:34:38] ENGINE Shutting down due to error in start listener: Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/cherrypy/process/wspbus.py", line 253, in start self.publish('start') File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/cherrypy/process/wspbus.py", line 233, in publish raise exc cherrypy.process.wspbus.ChannelFailures: Timeout('Port 5000 not free on 0.0.0.0.')

[14/Oct/2022:19:34:38] ENGINE Bus STOPPING [2022-10-14 19:34:38] INFO: [14/Oct/2022:19:34:38] ENGINE Bus STOPPING [14/Oct/2022:19:34:38] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 5000)) already shut down [2022-10-14 19:34:38] INFO: [14/Oct/2022:19:34:38] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 5000)) already shut down [14/Oct/2022:19:34:38] ENGINE Stopped thread '_TimeoutMonitor'. [2022-10-14 19:34:38] INFO: [14/Oct/2022:19:34:38] ENGINE Stopped thread '_TimeoutMonitor'. [14/Oct/2022:19:34:38] ENGINE Bus STOPPED [2022-10-14 19:34:38] INFO: [14/Oct/2022:19:34:38] ENGINE Bus STOPPED [14/Oct/2022:19:34:38] ENGINE Bus EXITING [2022-10-14 19:34:38] INFO: [14/Oct/2022:19:34:38] ENGINE Bus EXITING [14/Oct/2022:19:34:38] ENGINE Bus EXITED [2022-10-14 19:34:38] INFO: [14/Oct/2022:19:34:38] ENGINE Bus EXITED aaron@Aarons-MacBook-Pro pikaraoke2 % `

AaronMeyers avatar Oct 15 '22 02:10 AaronMeyers

ok i solved it in time... turns out that on macOS Monterey, Control Center is listening on port 5000. the solution is here: https://developer.apple.com/forums/thread/682332

maybe pikaraoke should choose a new port on macOS to avoid this little snafu

AaronMeyers avatar Oct 15 '22 03:10 AaronMeyers