Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Fails to run after install on Raspbian, no module named 'websocket' #345

Closed
octobarian opened this issue Jul 10, 2024 · 8 comments
Closed

Comments

@octobarian
Copy link

Describe the bug
PLEASE FILL THIS FORM OUT ENTIRELY for a response.

Is this a bug or a question? Questions and tech support inquiries should be directed to the "Discussions" section where your question may already be answered. If it's a bug, provide a clear and concise description of what the bug is here.

To Reproduce
Steps to reproduce the behavior:

  1. Install raspbian 64bit from raspberry pi installer
  2. git clone the repo
  3. ./setup.sh
  4. ./pikaraoke.sh
  5. Error

pi@Karaoke:~/pikaraoke $ ./pikaraoke.sh Traceback (most recent call last): File "/home/pi/pikaraoke/app.py", line 20, in <module> from selenium import webdriver File "/home/pi/pikaraoke/.venv/lib/python3.11/site-packages/selenium/webdriver/__init__.py", line 20, in <module> from .chrome.webdriver import WebDriver as Chrome # noqa ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/pi/pikaraoke/.venv/lib/python3.11/site-packages/selenium/webdriver/chrome/webdriver.py", line 18, in <module> from selenium.webdriver.chromium.webdriver import ChromiumDriver File "/home/pi/pikaraoke/.venv/lib/python3.11/site-packages/selenium/webdriver/chromium/webdriver.py", line 22, in <module> from selenium.webdriver.remote.webdriver import WebDriver as RemoteWebDriver File "/home/pi/pikaraoke/.venv/lib/python3.11/site-packages/selenium/webdriver/remote/webdriver.py", line 67, in <module> from .websocket_connection import WebSocketConnection File "/home/pi/pikaraoke/.venv/lib/python3.11/site-packages/selenium/webdriver/remote/websocket_connection.py", line 23, in <module> from websocket import WebSocketApp ModuleNotFoundError: No module named 'websocket'

Expected behavior
Should have installed and ran, but instead errors with websocket

Screenshots
If applicable, add screenshots to help explain your problem.

Platform (please complete the following information):

  • Hardware: Raspberry Pi 4B
  • OS: Raspberry pi OS
  • OS version: Raspberry pi Debian 64-bit
@octobarian
Copy link
Author

Just adding, if i install websocket-client manually

(.venv) pi@Karaoke:~/pikaraoke $ pip install websocket-client

then if i run ./pikaraoke.sh i will get this error instead.

pi@Karaoke:~/pikaraoke $ ./pikaraoke.sh Creating download path: /home/pi/pikaraoke-songs/ [2024-07-10 16:51:00] INFO: Fetching available songs in: /home/pi/pikaraoke-songs/ [10/Jul/2024:16:51:01] ENGINE Bus STARTING [2024-07-10 16:51:01] INFO: [10/Jul/2024:16:51:01] ENGINE Bus STARTING [10/Jul/2024:16:51:01] ENGINE Serving on http://0.0.0.0:5555 [2024-07-10 16:51:01] INFO: [10/Jul/2024:16:51:01] ENGINE Serving on http://0.0.0.0:5555 [10/Jul/2024:16:51:01] ENGINE Bus STARTED [2024-07-10 16:51:01] INFO: [10/Jul/2024:16:51:01] ENGINE Bus STARTED Traceback (most recent call last): File "/home/pi/pikaraoke/app.py", line 899, in <module> driver = webdriver.Chrome(service=service, options=options) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/pi/pikaraoke/.venv/lib/python3.11/site-packages/selenium/webdriver/chrome/webdriver.py", line 45, in __init__ super().__init__( File "/home/pi/pikaraoke/.venv/lib/python3.11/site-packages/selenium/webdriver/chromium/webdriver.py", line 66, in __init__ super().__init__(command_executor=executor, options=options) File "/home/pi/pikaraoke/.venv/lib/python3.11/site-packages/selenium/webdriver/remote/webdriver.py", line 212, in __init__ self.start_session(capabilities) File "/home/pi/pikaraoke/.venv/lib/python3.11/site-packages/selenium/webdriver/remote/webdriver.py", line 299, in start_session response = self.execute(Command.NEW_SESSION, caps)["value"] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/pi/pikaraoke/.venv/lib/python3.11/site-packages/selenium/webdriver/remote/webdriver.py", line 354, in execute self.error_handler.check_response(response) File "/home/pi/pikaraoke/.venv/lib/python3.11/site-packages/selenium/webdriver/remote/errorhandler.py", line 229, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.SessionNotCreatedException: Message: session not created: Chrome failed to start: exited normally. (session not created: DevToolsActivePort file doesn't exist) (The process started from chrome location /usr/bin/chromium-browser is no longer running, so ChromeDriver is assuming that Chrome has crashed.) Stacktrace: #0 0x00555badda44 <unknown> #1 0x00555b80aac0 <unknown> #2 0x00555b839700 <unknown> #3 0x00555b8363ac <unknown> #4 0x00555b87572c <unknown> #5 0x00555b84154c <unknown> #6 0x00555b841f38 <unknown> #7 0x00555baa918c <unknown> #8 0x00555baac7d8 <unknown> #9 0x00555ba98d3c <unknown> #10 0x00555baace6c <unknown> #11 0x00555ba814bc <unknown> #12 0x00555bacd5b4 <unknown> #13 0x00555bacd784 <unknown> #14 0x00555badcb8c <unknown> #15 0x007fb74eee58 <unknown> #16 0x007fb7557f9c <unknown>

@Hartebee5t
Copy link
Contributor

Your issue seems very similar to several variants within this Discussion thread, begun (and OP resolved) last December:
#298.
There were several subsequent resurrections along the same lines since then, the most recent of them raised only 2 weeks ago.
It'd be worth taking a look at the various earlier solutions throughout that thread to see if any might resolve your own instance of it. Failing that, yours and the most recent post in that thread may have identified a fresh variation.

Regards
D

@longelf
Copy link

longelf commented Jul 11, 2024

I got this too on my 3b+ after installing onto an SSD, running off the SD card it worked just fine, so I assumed there was some issue with the virtual Python environment when run off the SSD, I'm just leaving it on the SD card for now.

@vicwomg
Copy link
Owner

vicwomg commented Jul 11, 2024

Seeing a lot of reports of errors of this nature. It's starting to look like the latest chromedriver (or related package) broke stuff.

Curious: does it work in headless mode? ./pikaraoke.sh --headless note that you'll have to manually open a browser and go to the splash screen separately

@vicwomg
Copy link
Owner

vicwomg commented Jul 11, 2024

I believe Selenium broke this. This ticket coincides when we started seeing this issue (2 weeks ago)
SeleniumHQ/selenium#14184

@vicwomg
Copy link
Owner

vicwomg commented Jul 11, 2024

I don't have my pi handy, but might be worth trying reverting to the previous version of selenium:

Edit:requirements.txt
Change selenium to selenium==4.21.0
Re-run ./setup.sh

@jsalzer
Copy link

jsalzer commented Jul 13, 2024

I was having the same issue and can confirm that changing from "selenium" to "selenium==4.21.0" fixed the websockets issue for me.

@vicwomg
Copy link
Owner

vicwomg commented Jul 13, 2024

Thanks for confirmation.

I have committed the selenium version designation to the main branch. A git pull and rerun of ./setup.sh should fix this for affected users and new users should be fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants