yeates / PromptFix

[NeurIPS 24] PromptFix: You Prompt and We Fix the Photo
Apache License 2.0
618 stars 36 forks source link

How to Fix "ImportError: libGL.so.1: cannot open shared object file" Issue #13

Open Brandon-c-tech opened 6 days ago

Brandon-c-tech commented 6 days ago

If you encounter this issue: 如果你遇到了这个问题:

Traceback (most recent call last): File "/root/PromptFix/scripts/../process_images_json.py", line 23, in from stable_diffusion.ldm.hfp import extract_high_freq_component, sobel_operator File "/root/PromptFix/stable_diffusion/ldm/hfp.py", line 2, in import cv2 File "/opt/conda/envs/promptfix/lib/python3.10/site-packages/cv2/init.py", line 181, in bootstrap() File "/opt/conda/envs/promptfix/lib/python3.10/site-packages/cv2/init.py", line 153, in bootstrap native_module = importlib.import_module("cv2") File "/opt/conda/envs/promptfix/lib/python3.10/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ImportError: libGL.so.1: cannot open shared object file: No such file or directory

This can resolve it. 这可以解决:

apt-get update && apt-get install -y \
    libgl1-mesa-glx \
    libglib2.0-0