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]: (Macos) - ImportError: dlopen(/Users/mac/stable-diffusion-webui/venv/lib/python3.10/site-packages/cv2/cv2.abi3.so, 2): Symbol not found: #8168

Closed
1 task done
wangmings opened this issue Feb 27, 2023 · 17 comments
Labels
asking-for-help-with-local-system-issues This issue is asking for help related to local system; please offer assistance platform:mac Issues that apply to Apple OS X, M1, M2, etc

Comments

@wangmings
Copy link

Is there an existing issue for this?

  • 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: 0cc0ee1
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/python@3.10/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: 0cc0ee1
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/python@3.10/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 wangmings added the bug-report Report of a bug, yet to be confirmed label Feb 27, 2023
@ClashSAN ClashSAN changed the title [Bug]: There was a problem installing stable-diffusion-webui [Bug]: (Macos) - ImportError: dlopen(/Users/mac/stable-diffusion-webui/venv/lib/python3.10/site-packages/cv2/cv2.abi3.so, 2): Symbol not found: Feb 28, 2023
@rekcah1986
Copy link

me too.

1 similar comment
@Tesla-roger
Copy link

me too.

@wyzerg
Copy link

wyzerg commented Mar 27, 2023

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.

@TCnet
Copy link

TCnet commented Mar 27, 2023

me too

@yunming-lpf
Copy link

any solutions?

@Hanzvii
Copy link

Hanzvii commented Apr 3, 2023

me too

@adoontheway
Copy link

adoontheway commented Apr 4, 2023

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

@ruoruostar
Copy link

@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?

@adoontheway
Copy link

adoontheway commented Apr 4, 2023

@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
Copy link

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

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

@wangmings
Copy link
Author

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

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

@mitliucak
Copy link

@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

@Novery
Copy link

Novery commented Jun 8, 2023

@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

@catboxanon catboxanon added asking-for-help-with-local-system-issues This issue is asking for help related to local system; please offer assistance platform:mac Issues that apply to Apple OS X, M1, M2, etc and removed bug-report Report of a bug, yet to be confirmed labels Aug 3, 2023
@cyuanyang
Copy link

@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

@Jonyon
Copy link

Jonyon commented Apr 2, 2024

@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~

@radioqueen
Copy link

@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!

@lwmxiaobei
Copy link

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
asking-for-help-with-local-system-issues This issue is asking for help related to local system; please offer assistance platform:mac Issues that apply to Apple OS X, M1, M2, etc
Projects
None yet
Development

No branches or pull requests