Ikaros-521 / digital_human_video_player

洛曦 数字人视频播放器,带HTTP API,使用gradio api对接Easy-Wav2Lip、Sadtalker、GeneFacePlusPlus、MuseTalk,也可以用于播放本地视频
https://www.bilibili.com/video/BV1iW421P7si
GNU General Public License v3.0
135 stars 27 forks source link

我本地配置不够,所以租了云卡机, 4070,不过是linux 环境,运行咱们的播放器报这个错误。云主机应该翻不了墙。 #6

Open QuintinTao opened 1 week ago

QuintinTao commented 1 week ago

INFO: Uvicorn running on http://127.0.0.1:8091 (Press CTRL+C to quit) Exception in thread Thread-1: Traceback (most recent call last): File "/data/miniconda/envs/player/lib/python3.10/site-packages/selenium/webdriver/common/driver_finder.py", line 67, in _binary_paths output = SeleniumManager().binary_paths(self._to_args()) File "/data/miniconda/envs/player/lib/python3.10/site-packages/selenium/webdriver/common/selenium_manager.py", line 55, in binary_paths return self._run(args) File "/data/miniconda/envs/player/lib/python3.10/site-packages/selenium/webdriver/common/selenium_manager.py", line 129, in _run raise WebDriverException( selenium.common.exceptions.WebDriverException: Message: Unsuccessful command executed: /data/miniconda/envs/player/lib/python3.10/site-packages/selenium/webdriver/common/linux/selenium-manager --browser chrome --language-binding python --output json; code: 65 {'code': 65, 'message': 'error sending request for url (https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json)', 'driver_path': '', 'browser_path': ''}

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/data/miniconda/envs/player/lib/python3.10/threading.py", line 1016, in _bootstrap_inner self.run() File "/data/digital_human_video_player-main/api_server.py", line 333, in run self._target(self._stop_event) File "/data/digital_human_video_player-main/api_server.py", line 313, in start_browser driver = webdriver.Chrome(options=options) File "/data/miniconda/envs/player/lib/python3.10/site-packages/selenium/webdriver/chrome/webdriver.py", line 45, in init super().init( File "/data/miniconda/envs/player/lib/python3.10/site-packages/selenium/webdriver/chromium/webdriver.py", line 50, in init if finder.get_browser_path(): File "/data/miniconda/envs/player/lib/python3.10/site-packages/selenium/webdriver/common/driver_finder.py", line 47, in get_browser_path return self._binary_paths()["browser_path"] File "/data/miniconda/envs/player/lib/python3.10/site-packages/selenium/webdriver/common/driver_finder.py", line 78, in _binary_paths raise NoSuchDriverException(msg) from err selenium.common.exceptions.NoSuchDriverException: Message: Unable to obtain driver for chrome; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors/driver_location

Ikaros-521 commented 1 week ago

总结 手动下载chrome内核


从错误信息来看,Selenium 试图自动下载适用于 Chrome 的 WebDriver,但遇到了网络问题。具体来说,它无法访问 https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json 来获取最新的 ChromeDriver 下载链接。这可能是由于网络连接问题、防火墙设置或代理配置阻止了请求。

要解决这个问题,你可以尝试以下几种方法:

  1. 手动下载 ChromeDriver:

    • 访问 ChromeDriver 官方网站 手动下载与你的 Chrome 浏览器版本相匹配的 ChromeDriver。
    • 将下载好的 ChromeDriver 放置在一个你知道的位置,然后在创建 WebDriver 实例时通过 executable_path 参数指定它的路径。例如:

      from selenium import webdriver
      from selenium.webdriver.chrome.service import Service
      
      service = Service(executable_path='/path/to/chromedriver')
      driver = webdriver.Chrome(service=service, options=options)
  2. 检查网络连接和防火墙设置:

    • 确保你的机器能够正常访问互联网,并且没有被防火墙或安全软件阻止对上述 URL 的访问。
    • 如果你是在公司网络中,可能需要配置代理服务器。可以使用 webdriver.ChromeOptions() 添加代理设置。
  3. 使用 Selenium Manager 的替代方案:

    • 如果你不想手动处理 WebDriver 的下载和更新,可以考虑使用第三方工具如 WebDriverManager for Python,它可以帮助自动化这个过程。安装后,可以这样使用:

      pip install webdriver-manager
      from selenium import webdriver
      from webdriver_manager.chrome import ChromeDriverManager
      
      driver = webdriver.Chrome(ChromeDriverManager().install(), options=options)
  4. 确保正确的浏览器版本:

    • 检查你的 Chrome 浏览器版本,并确保你下载的 ChromeDriver 版本与此兼容。不匹配的版本可能会导致类似的问题。
  5. 查看 Selenium 文档:

    • 错误信息中提到的文档页面 (https://www.selenium.dev/documentation/webdriver/troubleshooting/errors/driver_location) 可能会有更多针对此类问题的建议和解决方案。

请根据你的具体情况选择合适的解决方法。如果这些步骤不能解决问题,请提供更多的上下文信息以便进一步诊断。

QuintinTao commented 1 week ago

2024-10-17 17:29:47 - /data/digital_human_video_player-main/api_server.py[line:40] - INFO: static_folder=/data/digital_human_video_player-main/static INFO: Started server process [6674] INFO: Waiting for application startup. INFO: Application startup complete. INFO: Uvicorn running on http://127.0.0.1:8091 (Press CTRL+C to quit) 2024-10-17 17:29:47 - /data/miniconda/envs/player/lib/python3.10/site-packages/selenium/webdriver/common/selenium_manager.py[line:138] - WARNING: Exception managing chrome: error sending request for url (https://googlechromelabs.github.io/chrome-for-testing/known-good-versions-with-downloads.json) Exception in thread Thread-1: Traceback (most recent call last): File "/data/miniconda/envs/player/lib/python3.10/threading.py", line 1016, in _bootstrap_inner self.run() File "/data/digital_human_video_player-main/api_server.py", line 334, in run self._target(self._stop_event) File "/data/digital_human_video_player-main/api_server.py", line 313, in start_browser driver = webdriver.Chrome(options=options) File "/data/miniconda/envs/player/lib/python3.10/site-packages/selenium/webdriver/chrome/webdriver.py", line 45, in init super().init( File "/data/miniconda/envs/player/lib/python3.10/site-packages/selenium/webdriver/chromium/webdriver.py", line 66, in init super().init(command_executor=executor, options=options) File "/data/miniconda/envs/player/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 212, in init self.start_session(capabilities) File "/data/miniconda/envs/player/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 299, in start_session response = self.execute(Command.NEW_SESSION, caps)["value"] File "/data/miniconda/envs/player/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 354, in execute self.error_handler.check_response(response) File "/data/miniconda/envs/player/lib/python3.10/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/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.) Stacktrace:

0 0x55984bed00aa

1 0x55984b9e71a0

2 0x55984ba1cfaa

3 0x55984ba18885

4 0x55984ba63ec6

5 0x55984ba63516

6 0x55984ba57b23

7 0x55984ba26990

8 0x55984ba2796e

9 0x55984be9c16b

10 0x55984be9ff68

11 0x55984be8964c

12 0x55984bea0ae7

13 0x55984be6e4af

14 0x55984bebe4f8

15 0x55984bebe6c0

16 0x55984becef26

17 0x7f9a0fb6c609 start_thread

QuintinTao commented 1 week ago

我把driver 手动安装了。ubuntu 环境。报这个。貌似服务也没起来

Ikaros-521 commented 1 week ago

2024-10-17 17:29:47 - /data/digital_human_video_player-main/api_server.py[line:40] - INFO: static_folder=/data/digital_human_video_player-main/static INFO: Started server process [6674] INFO: Waiting for application startup. INFO: Application startup complete. INFO: Uvicorn running on http://127.0.0.1:8091 (Press CTRL+C to quit) 2024-10-17 17:29:47 - /data/miniconda/envs/player/lib/python3.10/site-packages/selenium/webdriver/common/selenium_manager.py[line:138] - WARNING: Exception managing chrome: error sending request for url (https://googlechromelabs.github.io/chrome-for-testing/known-good-versions-with-downloads.json) Exception in thread Thread-1: Traceback (most recent call last): File "/data/miniconda/envs/player/lib/python3.10/threading.py", line 1016, in _bootstrap_inner self.run() File "/data/digital_human_video_player-main/api_server.py", line 334, in run self._target(self._stop_event) File "/data/digital_human_video_player-main/api_server.py", line 313, in start_browser driver = webdriver.Chrome(options=options) File "/data/miniconda/envs/player/lib/python3.10/site-packages/selenium/webdriver/chrome/webdriver.py", line 45, in init super().init( File "/data/miniconda/envs/player/lib/python3.10/site-packages/selenium/webdriver/chromium/webdriver.py", line 66, in init super().init(command_executor=executor, options=options) File "/data/miniconda/envs/player/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 212, in init self.start_session(capabilities) File "/data/miniconda/envs/player/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 299, in start_session response = self.execute(Command.NEW_SESSION, caps)["value"] File "/data/miniconda/envs/player/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 354, in execute self.error_handler.check_response(response) File "/data/miniconda/envs/player/lib/python3.10/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/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.) Stacktrace:

0 0x55984bed00aa

1 0x55984b9e71a0

2 0x55984ba1cfaa

3 0x55984ba18885

4 0x55984ba63ec6

5 0x55984ba63516

6 0x55984ba57b23

7 0x55984ba26990

8 0x55984ba2796e

9 0x55984be9c16b

10 0x55984be9ff68

11 0x55984be8964c

12 0x55984bea0ae7

13 0x55984be6e4af

14 0x55984bebe4f8

15 0x55984bebe6c0

16 0x55984becef26

17 0x7f9a0fb6c609 start_thread

似曾相识,不过忘记怎么搞得了。

Ikaros-521 commented 1 week ago

好像还是内核问题,具体想不起来了。得查查资料

QuintinTao commented 1 week ago

OK 大佬慢慢想

Ikaros-521 commented 1 week ago

OK 大佬慢慢想

已经失忆了,剩下的路 得靠自己了 image