stable-diffusion-webui icon indicating copy to clipboard operation
stable-diffusion-webui copied to clipboard

[Bug]: (Macos) - ImportError: dlopen(/Users/mac/stable-diffusion-webui/venv/lib/python3.10/site-packages/cv2/cv2.abi3.so, 2): Symbol not found:

Open wangmings opened this issue 2 years ago • 2 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues and checked the recent builds/commits

What happened?

./ webui.sh There is a problem installing to the following step

Python 3.10.9 (main, Jan 25 2023, 14:19:22) [Clang 12.0.0 (clang-1200.0.32.29)] Commit hash: 0cc0ee1bcb4c24a8c9715f66cede06601bfc00c8 Installing requirements for Web UI Launching Web UI with arguments: --upcast-sampling --no-half-vae --use-cpu interrogate Traceback (most recent call last): File "/Users/mac/stable-diffusion-webui/launch.py", line 361, in start() File "/Users/mac/stable-diffusion-webui/launch.py", line 352, in start import webui File "/Users/mac/stable-diffusion-webui/webui.py", line 15, in from modules import import_hook, errors, extra_networks, ui_extra_networks_checkpoints File "/Users/mac/stable-diffusion-webui/modules/ui_extra_networks_checkpoints.py", line 6, in from modules import shared, ui_extra_networks, sd_models File "/Users/mac/stable-diffusion-webui/modules/shared.py", line 12, in import modules.interrogate File "/Users/mac/stable-diffusion-webui/modules/interrogate.py", line 15, in from modules import devices, paths, shared, lowvram, modelloader, errors File "/Users/mac/stable-diffusion-webui/modules/modelloader.py", line 7, in from basicsr.utils.download_util import load_file_from_url File "/Users/mac/stable-diffusion-webui/venv/lib/python3.10/site-packages/basicsr/init.py", line 3, in from .archs import * File "/Users/mac/stable-diffusion-webui/venv/lib/python3.10/site-packages/basicsr/archs/init.py", line 5, in from basicsr.utils import get_root_logger, scandir File "/Users/mac/stable-diffusion-webui/venv/lib/python3.10/site-packages/basicsr/utils/init.py", line 4, in from .img_process_util import USMSharp, usm_sharp File "/Users/mac/stable-diffusion-webui/venv/lib/python3.10/site-packages/basicsr/utils/img_process_util.py", line 1, in import cv2 File "/Users/mac/stable-diffusion-webui/venv/lib/python3.10/site-packages/cv2/init.py", line 181, in bootstrap() File "/Users/mac/stable-diffusion-webui/venv/lib/python3.10/site-packages/cv2/init.py", line 153, in bootstrap native_module = importlib.import_module("cv2") File "/usr/local/Cellar/[email protected]/3.10.9/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ImportError: dlopen(/Users/mac/stable-diffusion-webui/venv/lib/python3.10/site-packages/cv2/cv2.abi3.so, 2): Symbol not found: _VTRegisterSupplementalVideoDecoderIfAvailable Referenced from: /Users/mac/stable-diffusion-webui/venv/lib/python3.10/site-packages/cv2/.dylibs/libavcodec.59.37.100.dylib (which was built for Mac OS X 11.0) Expected in: /System/Library/Frameworks/VideoToolbox.framework/Versions/A/VideoToolbox in /Users/mac/stable-diffusion-webui/venv/lib/python3.10/site-packages/cv2/.dylibs/libavcodec.59.37.100.dylib

Steps to reproduce the problem

 ./webui.sh

################################################################ Install script for stable-diffusion + Web UI Tested on Debian 11 (Bullseye) ################################################################

################################################################ Running on mac user ################################################################

################################################################ Repo already cloned, using it as install directory ################################################################

################################################################ Create and activate python venv ################################################################

################################################################ Launching launch.py... ################################################################ Python 3.10.9 (main, Jan 25 2023, 14:19:22) [Clang 12.0.0 (clang-1200.0.32.29)] Commit hash: 0cc0ee1bcb4c24a8c9715f66cede06601bfc00c8 Installing requirements for Web UI Launching Web UI with arguments: --upcast-sampling --no-half-vae --use-cpu interrogate Traceback (most recent call last): File "/Users/mac/stable-diffusion-webui/launch.py", line 361, in start() File "/Users/mac/stable-diffusion-webui/launch.py", line 352, in start import webui File "/Users/mac/stable-diffusion-webui/webui.py", line 15, in from modules import import_hook, errors, extra_networks, ui_extra_networks_checkpoints File "/Users/mac/stable-diffusion-webui/modules/ui_extra_networks_checkpoints.py", line 6, in from modules import shared, ui_extra_networks, sd_models File "/Users/mac/stable-diffusion-webui/modules/shared.py", line 12, in import modules.interrogate File "/Users/mac/stable-diffusion-webui/modules/interrogate.py", line 15, in from modules import devices, paths, shared, lowvram, modelloader, errors File "/Users/mac/stable-diffusion-webui/modules/modelloader.py", line 7, in from basicsr.utils.download_util import load_file_from_url File "/Users/mac/stable-diffusion-webui/venv/lib/python3.10/site-packages/basicsr/init.py", line 3, in from .archs import * File "/Users/mac/stable-diffusion-webui/venv/lib/python3.10/site-packages/basicsr/archs/init.py", line 5, in from basicsr.utils import get_root_logger, scandir File "/Users/mac/stable-diffusion-webui/venv/lib/python3.10/site-packages/basicsr/utils/init.py", line 4, in from .img_process_util import USMSharp, usm_sharp File "/Users/mac/stable-diffusion-webui/venv/lib/python3.10/site-packages/basicsr/utils/img_process_util.py", line 1, in import cv2 File "/Users/mac/stable-diffusion-webui/venv/lib/python3.10/site-packages/cv2/init.py", line 181, in bootstrap() File "/Users/mac/stable-diffusion-webui/venv/lib/python3.10/site-packages/cv2/init.py", line 153, in bootstrap native_module = importlib.import_module("cv2") File "/usr/local/Cellar/[email protected]/3.10.9/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ImportError: dlopen(/Users/mac/stable-diffusion-webui/venv/lib/python3.10/site-packages/cv2/cv2.abi3.so, 2): Symbol not found: _VTRegisterSupplementalVideoDecoderIfAvailable Referenced from: /Users/mac/stable-diffusion-webui/venv/lib/python3.10/site-packages/cv2/.dylibs/libavcodec.59.37.100.dylib (which was built for Mac OS X 11.0) Expected in: /System/Library/Frameworks/VideoToolbox.framework/Versions/A/VideoToolbox in /Users/mac/stable-diffusion-webui/venv/lib/python3.10/site-packages/cv2/.dylibs/libavcodec.59.37.100.dylib

What should have happened?

hello

Commit where the problem happens

hello

What platforms do you use to access the UI ?

MacOS

What browsers do you use to access the UI ?

Google Chrome

Command Line Arguments

## hello

List of extensions

hello

Console logs

## hello

Additional information

hello

wangmings avatar Feb 27 '23 14:02 wangmings

me too.

rekcah1986 avatar Mar 13 '23 09:03 rekcah1986

me too.

Tesla-roger avatar Mar 17 '23 11:03 Tesla-roger

me too . I also encountered this error, but I found that it is caused by the Mac system version not being compatible. This error message: Referenced from: /Users/xxxxx/Downloads/stable-diffusion-webui/venv/lib/python3.10/site-packages/cv2/.dylibs/libavcodec.59.37.100.dylib (which was built for Mac OS X 11.0)

My system is 10.15, does it not meet the installation requirements? Thank you for your attention.

wyzerg avatar Mar 27 '23 10:03 wyzerg

me too

TCnet avatar Mar 27 '23 11:03 TCnet

any solutions?

yunming-lpf avatar Apr 01 '23 15:04 yunming-lpf

me too

Hanzvii avatar Apr 03 '23 04:04 Hanzvii

Hi,everyone. I've been encounted the same issue. and then i downgrade the opencv_python version from 4.7.0.68(which used in this repo now) to 4.5.5.64. and this issue is fixed.

not exactly know what would be occurred, but so far so good. Wish you guys all as well.

UPDATE: it is running perfectly.

@wangmings @Hanzvii @yunming-lpf @TCnet @Tesla-roger

adoontheway avatar Apr 04 '23 05:04 adoontheway

@adoontheway I am running mac OS 10.15.7 and I am getting the same error message. How do I degrade the opencv_python version?

ruoruostar avatar Apr 04 '23 10:04 ruoruostar

@ruoruostar my mac os is 10.15.6

  1. active the venv: source ./venv/bin/activate
  2. run pip uninstall opencv_python , it will remind you uninstall both opencv_python and cv2, chose yes
  3. pip install opencv_python==4.5.5.64

adoontheway avatar Apr 04 '23 13:04 adoontheway

i think you guys sucks. not deserve my help after use my solution without any feedback and thanks.

我觉得你们这些 比人 不值得别人的帮助, 用了别人的解决方案,没有反馈,没有谢谢。

adoontheway avatar Apr 25 '23 11:04 adoontheway

Ha ha! Peaceful communication, don't run away! I see your solution! Verified, feasible! Thank you for your reply!

呵呵!和平交流,不要暴走!我看到你的解决方案!验证了,可行!感谢你的回复!

wangmings avatar Apr 27 '23 15:04 wangmings

@ruoruostar my mac os is 10.15.6

  1. active the venv: source ./venv/bin/activate
  2. run pip uninstall opencv_python , it will remind you uninstall both opencv_python and cv2, chose yes
  3. pip install opencv_python==4.5.5.64

thanks very much, its works in mac os

mitliucak avatar May 22 '23 07:05 mitliucak

@ruoruostar my mac os is 10.15.6

  1. active the venv: source ./venv/bin/activate
  2. run pip uninstall opencv_python , it will remind you uninstall both opencv_python and cv2, chose yes
  3. pip install opencv_python==4.5.5.64

Thank you very much, this method works successfully

Novery avatar Jun 08 '23 10:06 Novery

@ruoruostar my mac os is 10.15.6

  1. active the venv: source ./venv/bin/activate
  2. run pip uninstall opencv_python , it will remind you uninstall both opencv_python and cv2, chose yes
  3. pip install opencv_python==4.5.5.64

Thanks very much

cyuanyang avatar Oct 02 '23 07:10 cyuanyang

@ruoruostar my mac os is 10.15.6

  1. active the venv: source ./venv/bin/activate
  2. run pip uninstall opencv_python , it will remind you uninstall both opencv_python and cv2, chose yes
  3. pip install opencv_python==4.5.5.64

thank you very much~

Jonyon avatar Apr 02 '24 09:04 Jonyon

@ruoruostar my mac os is 10.15.6

  1. active the venv: source ./venv/bin/activate
  2. run pip uninstall opencv_python , it will remind you uninstall both opencv_python and cv2, chose yes
  3. pip install opencv_python==4.5.5.64

it works in 11.7.10! thank you!

radioqueen avatar Apr 07 '24 07:04 radioqueen

@ruoruostar my mac os is 10.15.6

  1. active the venv: source ./venv/bin/activate
  2. run pip uninstall opencv_python , it will remind you uninstall both opencv_python and cv2, chose yes
  3. pip install opencv_python==4.5.5.64

thank you so much

lwmxiaobei avatar May 16 '24 02:05 lwmxiaobei