CompVis / stable-diffusion

A latent text-to-image diffusion model
https://ommer-lab.com/research/latent-diffusion-models/
Other
67.83k stars 10.11k forks source link

"RuntimeError: Couldn't install gfpgan." When installing webui #506

Open toptiermongoloid opened 1 year ago

toptiermongoloid commented 1 year ago

i've managed to install Pytorch successfully, but now whenever i try to install gfpgan i get this error, what does it mean?

RuntimeError: Couldn't install gfpgan. Command: "C:\Users\user\Desktop\stable-diffusion-webui\venv\Scripts\python.exe" -m pip install git+https://github.com/TencentARC/GFPGAN.git@8d2447a2d918f8eba5a4a01463fd48e45126a379 --prefer-binary Error code: 2 stdout: stderr: Usage: C:\Users\user\Desktop\stable-diffusion-webui\venv\Scripts\python.exe -m pip install [options] [package-index-options] ... C:\Users\user\Desktop\stable-diffusion-webui\venv\Scripts\python.exe -m pip install [options] -r [package-index-options] ... C:\Users\user\Desktop\stable-diffusion-webui\venv\Scripts\python.exe -m pip install [options] [-e] ... C:\Users\user\Desktop\stable-diffusion-webui\venv\Scripts\python.exe -m pip install [options] [-e] ... C:\Users\user\Desktop\stable-diffusion-webui\venv\Scripts\python.exe -m pip install [options] <archive url/path> ...

no such option: --prefer-binary

toptiermongoloid commented 1 year ago

updating Python to 3.10 solved this issue, but now i have another one

RuntimeError: CUDA out of memory. Tried to allocate 20.00 MiB (GPU 0; 2.00 GiB total capacity; 1.68 GiB already allocated; 0 bytes free; 1.72 GiB reserved in total by PyTorch)

UserSA560110 commented 1 year ago

RuntimeError: Couldn't install gfpgan. I got the same error with Python 3.10. I was wondering how you solved it.

Edit: I had installed Python 3.10, but the older python version was still in my path file. I removed the offending version(s) and it works perfectly.

SlayingCobra commented 1 year ago

Any Luck? Mine says 'could not install gfpgan.'

pudey33 commented 1 year ago

I also have this error. Python 3.10.6. I first tried with Python 11, and I am wondering if that messed up the install.

adamwuyu commented 1 year ago

I met the same error.

VezlysNikita commented 1 year ago

me too

Ohems commented 1 year ago

I had a similar issue, but in my case it was not due to an unknown option --prefer-binary but rather due to a missing Git executable. Git was not in my Windows PATH and the installation requires it to install this particular component. Not directly related to the issue pointed out by the OP, but dropping this here for anyone who gets brought here by a gfpgan installation error.

rahulgurujala commented 1 year ago

I resolved it, Python version >= 3.8 is required. I used Python 3.9.10. Then run ./webui.sh. If you still get an error then manually download gfpgan using the following command: python3 -m pip install git+https://github.com/TencentARC/GFPGAN.git@8d2447a2d918f8eba5a4a01463fd48e45126a379 --prefer-binary It works for me. Please let me know if any issues.

NOTE: before changing Python version, don't forget to remove venv folder

CilentBartner commented 1 year ago

If you still get an error then manually download gfpgan using the following command: python3 -m pip install git+https://github.com/TencentARC/GFPGAN.git@8d2447a2d918f8eba5a4a01463fd48e45126a379 --prefer-binary It works for me. Please let me know if any issues.

Running that resulted in many "Requirement already satisfied" notices; the original problem persists. GIT is installed to PATH.

Robin-WZQ commented 1 year ago

My python version is 3.10.6 (Windows11), but it still give me this error.

I believe it has the same solution as git https fatal: HTTP request failed.

My method (write done these in your cmd one by one):

git config --global http.sslverify true git config --global http.sslCAPath /etc/pki/tls/certs git config --global http.postBuffer 524288000

Genius-pig commented 1 year ago

for most Chinese users, run python3 -m pip install git+https://ghproxy.com/https://github.com/TencentARC/GFPGAN.git@8d2447a2d918f8eba5a4a01463fd48e45126a379 --prefer-binary

but if you run ./webui.sh, you still get same error. please change all https://github.com/ into https://ghproxy.com/https://github.com/ in stable-diffusion-webui/launch.py.

if you happend to know chinese, please read this tutorial. https://zhuanlan.zhihu.com/p/608397859

925-Studio commented 1 year ago

for most Chinese users, run python3 -m pip install git+https://ghproxy.com/https://github.com/TencentARC/GFPGAN.git@8d2447a2d918f8eba5a4a01463fd48e45126a379 --prefer-binary

And also you need to change your VPN to global and set the proxy in terminal. For an example, select copy shell command in Clash menu then paste it in terminal and press enter.

rocaltair commented 1 year ago

for most Chinese users, run python3 -m pip install git+https://ghproxy.com/https://github.com/TencentARC/GFPGAN.git@8d2447a2d918f8eba5a4a01463fd48e45126a379 --prefer-binary

very helpful !!!

CKMWithoutPhaseAngle commented 1 year ago

Dear friends,

for most Chinese users, run python3 -m pip install git+https://ghproxy.com/https://github.com/TencentARC/GFPGAN.git@8d2447a2d918f8eba5a4a01463fd48e45126a379 --prefer-binary

And also you need to change your VPN to global and set the proxy in terminal. For an example, select copy shell command in Clash menu then paste it in terminal and press enter.

I followed this and Successfully built gfpgan basicsr lmdb filterpy future, with this , I ran ./webui.sh , I still get RuntimeError: Couldn't install gfpgan.

Do you have any idea what is going on?

Genius-pig commented 1 year ago

@CKMWithoutPhaseAngle I update my comment.

westside24 commented 1 year ago

it works!!

calcocaty commented 1 year ago

im getting to installing gfpgan and its just hanging there not doing anything

CKMWithoutPhaseAngle commented 1 year ago

@CKMWithoutPhaseAngle I update my comment.

Thanks a lot. This works!

UncleLLD commented 1 year ago
  1. first install cython by stable-diffusion-webui/venv/bin/python3 -m pip install cython ;
  2. and then change all https://github.com/ into https://ghproxy.com/https://github.com/ in stable-diffusion-webui/launch.py;
  3. and then ./webui.sh
AkMesitochito commented 1 year ago

I resolved it, Python version >= 3.8 is required. I used Python 3.9.10. Then run ./webui.sh. If you still get an error then manually download gfpgan using the following command: python3 -m pip install git+https://github.com/TencentARC/GFPGAN.git@8d2447a2d918f8eba5a4a01463fd48e45126a379 --prefer-binary It works for me. Please let me know if any issues.

NOTE: before changing Python version, don't forget to remove venv folder

In what program i have to run that code? i have to just paste it like that?

liutengyuan1803 commented 1 year ago

in chinese area can try it ,use qinghua source python3 -m pip install git+https://ghproxy.com/https://github.com/TencentARC/GFPGAN.git@8d2447a2d918f8eba5a4a01463fd48e45126a379 --prefer-binary --default-timeout=100 -i https://pypi.tuna.tsinghua.edu.cn/simple

superfofo commented 1 year ago

in chinese area can try it ,use qinghua source python3 -m pip install git+https://ghproxy.com/https://github.com/TencentARC/GFPGAN.git@8d2447a2d918f8eba5a4a01463fd48e45126a379 --prefer-binary --default-timeout=100 -i https://pypi.tuna.tsinghua.edu.cn/simple

Thanks a lot. This works!

Aur-iii commented 1 year ago

im getting this error


Commit hash: 22bcc7be428c94e9408f589966c2040187245d81
Installing gfpgan
Traceback (most recent call last):
  File "/Users/aurifell/Desktop/Coding/AUTOMATIC1111/stable-diffusion-webui/launch.py", line 355, in <module>
    prepare_environment()
  File "/Users/aurifell/Desktop/Coding/AUTOMATIC1111/stable-diffusion-webui/launch.py", line 263, in prepare_environment
    run_pip(f"install {gfpgan_package}", "gfpgan")
  File "/Users/aurifell/Desktop/Coding/AUTOMATIC1111/stable-diffusion-webui/launch.py", line 129, in run_pip
    return run(f'"{python}" -m pip {args} --prefer-binary{index_url_line}', desc=f"Installing {desc}", errdesc=f"Couldn't install {desc}")
  File "/Users/aurifell/Desktop/Coding/AUTOMATIC1111/stable-diffusion-webui/launch.py", line 97, in run
    raise RuntimeError(message)
RuntimeError: Couldn't install gfpgan.
Command: "/Users/aurifell/Desktop/Coding/AUTOMATIC1111/stable-diffusion-webui/venv/bin/python3.10" -m pip install git+https://github.com/TencentARC/GFPGAN.git@8d2447a2d918f8eba5a4a01463fd48e45126a379 --prefer-binary
Error code: 1
stdout: Collecting git+https://github.com/TencentARC/GFPGAN.git@8d2447a2d918f8eba5a4a01463fd48e45126a379
  Cloning https://github.com/TencentARC/GFPGAN.git (to revision 8d2447a2d918f8eba5a4a01463fd48e45126a379) to /private/var/folders/xt/zgv9s0397hx_qqzm8kmjrww80000gn/T/pip-req-build-cqb9qmqe
  Resolved https://github.com/TencentARC/GFPGAN.git to commit 8d2447a2d918f8eba5a4a01463fd48e45126a379
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Collecting basicsr>=1.4.2
  Using cached basicsr-1.4.2.tar.gz (172 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Collecting facexlib>=0.2.5
  Using cached facexlib-0.2.5-py3-none-any.whl (59 kB)
Collecting lmdb
  Using cached lmdb-1.4.0.tar.gz (881 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Requirement already satisfied: numpy in ./venv/lib/python3.10/site-packages (from gfpgan==1.3.5) (1.24.2)
Collecting opencv-python
  Using cached opencv_python-4.7.0.72-cp37-abi3-macosx_11_0_arm64.whl (32.6 MB)
Collecting pyyaml
  Using cached PyYAML-6.0-cp310-cp310-macosx_11_0_arm64.whl (173 kB)
Collecting scipy
  Using cached scipy-1.10.1.tar.gz (42.4 MB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
  Installing backend dependencies: started
  Installing backend dependencies: finished with status 'done'
  Preparing metadata (pyproject.toml): started
  Preparing metadata (pyproject.toml): finished with status 'error'

stderr:   Running command git clone --filter=blob:none --quiet https://github.com/TencentARC/GFPGAN.git /private/var/folders/xt/zgv9s0397hx_qqzm8kmjrww80000gn/T/pip-req-build-cqb9qmqe
  Running command git rev-parse -q --verify 'sha^8d2447a2d918f8eba5a4a01463fd48e45126a379'
  Running command git fetch -q https://github.com/TencentARC/GFPGAN.git 8d2447a2d918f8eba5a4a01463fd48e45126a379
  Running command git checkout -q 8d2447a2d918f8eba5a4a01463fd48e45126a379
  error: subprocess-exited-with-error

  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [40 lines of output]
      The Meson build system
      Version: 1.0.1
      Source dir: /private/var/folders/xt/zgv9s0397hx_qqzm8kmjrww80000gn/T/pip-install-7rha6fp2/scipy_c4aa53716a844ffc88f7969d243c2bbe
      Build dir: /private/var/folders/xt/zgv9s0397hx_qqzm8kmjrww80000gn/T/pip-install-7rha6fp2/scipy_c4aa53716a844ffc88f7969d243c2bbe/.mesonpy-jvfd4dmq/build
      Build type: native build
      Project name: SciPy
      Project version: 1.10.1
      C compiler for the host machine: cc (clang 13.0.0 "Apple clang version 13.0.0 (clang-1300.0.29.30)")
      C linker for the host machine: cc ld64 711
      C++ compiler for the host machine: c++ (clang 13.0.0 "Apple clang version 13.0.0 (clang-1300.0.29.30)")
      C++ linker for the host machine: c++ ld64 711
      Cython compiler for the host machine: cython (cython 0.29.34)
      Host machine cpu family: aarch64
      Host machine cpu: aarch64
      Compiler for C supports arguments -Wno-unused-but-set-variable: NO
      Compiler for C supports arguments -Wno-unused-function: YES
      Compiler for C supports arguments -Wno-conversion: YES
      Compiler for C supports arguments -Wno-misleading-indentation: YES
      Compiler for C supports arguments -Wno-incompatible-pointer-types: YES
      Library m found: YES

      ../../meson.build:63:0: ERROR: Unknown compiler(s): [['gfortran'], ['flang'], ['nvfortran'], ['pgfortran'], ['ifort'], ['ifx'], ['g95']]
      The following exception(s) were encountered:
      Running `gfortran --version` gave "[Errno 2] No such file or directory: 'gfortran'"
      Running `gfortran -V` gave "[Errno 2] No such file or directory: 'gfortran'"
      Running `flang --version` gave "[Errno 2] No such file or directory: 'flang'"
      Running `flang -V` gave "[Errno 2] No such file or directory: 'flang'"
      Running `nvfortran --version` gave "[Errno 2] No such file or directory: 'nvfortran'"
      Running `nvfortran -V` gave "[Errno 2] No such file or directory: 'nvfortran'"
      Running `pgfortran --version` gave "[Errno 2] No such file or directory: 'pgfortran'"
      Running `pgfortran -V` gave "[Errno 2] No such file or directory: 'pgfortran'"
      Running `ifort --version` gave "[Errno 2] No such file or directory: 'ifort'"
      Running `ifort -V` gave "[Errno 2] No such file or directory: 'ifort'"
      Running `ifx --version` gave "[Errno 2] No such file or directory: 'ifx'"
      Running `ifx -V` gave "[Errno 2] No such file or directory: 'ifx'"
      Running `g95 --version` gave "[Errno 2] No such file or directory: 'g95'"
      Running `g95 -V` gave "[Errno 2] No such file or directory: 'g95'"

      A full log can be found at /private/var/folders/xt/zgv9s0397hx_qqzm8kmjrww80000gn/T/pip-install-7rha6fp2/scipy_c4aa53716a844ffc88f7969d243c2bbe/.mesonpy-jvfd4dmq/build/meson-logs/meson-log.txt
      + meson setup --prefix=/opt/homebrew/Cellar/python@3.10/3.10.10_1/Frameworks/Python.framework/Versions/3.10 /private/var/folders/xt/zgv9s0397hx_qqzm8kmjrww80000gn/T/pip-install-7rha6fp2/scipy_c4aa53716a844ffc88f7969d243c2bbe /private/var/folders/xt/zgv9s0397hx_qqzm8kmjrww80000gn/T/pip-install-7rha6fp2/scipy_c4aa53716a844ffc88f7969d243c2bbe/.mesonpy-jvfd4dmq/build --native-file=/private/var/folders/xt/zgv9s0397hx_qqzm8kmjrww80000gn/T/pip-install-7rha6fp2/scipy_c4aa53716a844ffc88f7969d243c2bbe/.mesonpy-native-file.ini -Ddebug=false -Doptimization=2
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.```

idk what to do, says it can't install gfpgan so idk
bluce commented 1 year ago

It work for me! modify launch.py

find out launch.py at root modify prepare_enviroment() modify https://github.com/ to https://ghproxy.com/https://github.com/ and relaunch webui.bat

eg: https://www.bilibili.com/read/cv19991459?from=search

Aur-iii commented 1 year ago

@bluce didnt work sadly

UriahKong commented 1 year ago

RuntimeError: Couldn't install gfpgan. I got the same error with Python 3.10. I was wondering how you solved it.

Edit: I had installed Python 3.10, but the older python version was still in my path file. I removed the offending version(s) and it works perfectly.

Sure bro.but how do you removed the offending version ?

Recle commented 1 year ago

修改temp 文件夹的权限

详情参阅(read this):https://github.com/AUTOMATIC1111/stable-diffusion-webui/discussions/8433#discussioncomment-5288509

https://github.com/AUTOMATIC1111/stable-diffusion-webui/discussions/8433#discussioncomment-5430548

你还可以通过git bash ,git clone 语句 将 gfpgan 下载到本地(stable-diffusion 的根目录)git clone https://github.com/TencentARC/GFPGAN cd gfpgan

arghhhhh commented 1 year ago

Adding 'https://ghproxy.com/' before all links in the prepare_environment() of launch.py like so worked for me

stable_diffusion_repo = os.environ.get('STABLE_DIFFUSION_REPO', "https://ghproxy.com/https://github.com/Stability-AI/stablediffusion.git") taming_transformers_repo = os.environ.get('TAMING_TRANSFORMERS_REPO', "https://ghproxy.com/https://github.com/CompVis/taming-transformers.git")

liuya1s commented 1 year ago

I resolved it, Python version >= 3.8 is required. I used Python 3.9.10. Then run ./webui.sh. If you still get an error then manually download gfpgan using the following command: python3 -m pip install git+https://github.com/TencentARC/GFPGAN.git@8d2447a2d918f8eba5a4a01463fd48e45126a379 --prefer-binary It works for me. Please let me know if any issues.

NOTE: before changing Python version, don't forget to remove venv folder

thanks a lot! I to do this(detail):

  1. Go to python venv environment: PS D:\AI\stable-diffusion-webui\venv\Scripts> .\activate (venv) PS D:\AI\stable-diffusion-webui\venv\Scripts>

  2. Excute python3 -m pip install git+https://github.com/TencentARC/GFPGAN.git@8d2447a2d918f8eba5a4a01463fd48e45126a379 --prefer-binary , and it run and successful

ArsFromNowhere commented 1 year ago

Still the same error, I tried with different versions of python (I did everything correctly) yes, and it's still not clear stderr: WARNING: Certificate did not match expected hostname: codeload.github.com. Certificate: {'subject': ((('commonName', 'dns.google'),),), 'issuer': ((('countryName', 'US'),), (('organizationName', ' Google Trust Services LLC'), (('commonName', 'GTS CA 1C3'),)) 'version': 3, 'serialNumber': '5800A3B42EEE5CDE10C93DBCA470F781', 'notBefore': 'May 22 08:22: 42 2023 GMT', 'notAfter': 'Aug 14 08:22:41 2023 GMT', 'subjectAltName': (('DNS', 'dns.google'), ('DNS', 'dns.google.com' ), ('DNS', '*.dns.google.com'), ('DNS', '8888.google'), ('DNS', 'dns64.dns.google'), ('IP Address', '8.8.8.8'), ('IP Address', '8.8.4.4'), ('IP Address', '2001:4860:4860:0:0:0:0:8888'), ('IP Address' , '2001:4860:4860:0:0:0:0:8844'), ('IP Address', '2001:4860:4860:0:0:0:0:6464'), ('IP Address' , '2001:4860:4860:0:0:0:0:64')), 'OCSP': ('http://ocsp.pki.goog/gts1c3',), 'caIssuers': ('http: //pki.goog/repo/certs/gts1c3.der',), 'crlDistributionPoints': ('http://crls.pki.goog/gts1c3/zdATt0Ex_Fk.crl',)} WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(CertificateError (there's a lot more)

WuSiYu commented 1 year ago

Got same issue when using the pypi mirror source of https://pypi.tuna.tsinghua.edu.cn/simple (commonly used for china mainland users), the error is caused by a installable tb-nightly package could not been found in the mirror.

It may due to the tuna's pypi mirror source doesn't sync the tb-nightly packages. So if you could have some way to reach the official pypi mirror source, just switch back to it and every things will go right.

TL;DR + chinese translate: 如果你的pip用了清华的pypi镜像源,那可能是清华源的问题,换回官方源就正常了(如果你能访问)

Joaaofiilho commented 1 year ago

I could solve it by just deleting the pip cache folder! You can find how you can delete it in this link from stackoverflow: https://stackoverflow.com/questions/9510474/pip-uses-incorrect-cached-package-version-instead-of-the-user-specified-version

ArsFromNowhere commented 1 year ago

Thanks, I solved this problem (the problem was with the Internet)

ср, 28 июн. 2023 г. в 03:55, João Ferreira @.***>:

I could solve it by just deleting the pip cache folder! You can find how you can delete it in this link from stackoverflow: https://stackoverflow.com/questions/9510474/pip-uses-incorrect-cached-package-version-instead-of-the-user-specified-version

— Reply to this email directly, view it on GitHub https://github.com/CompVis/stable-diffusion/issues/506#issuecomment-1610420646, or unsubscribe https://github.com/notifications/unsubscribe-auth/A3K5SCLRTYOTKM6NUG3NF7TXNN6IBANCNFSM6AAAAAASLNQCYA . You are receiving this because you commented.Message ID: @.***>

huifengshi commented 1 year ago

I resolved it, Python version >= 3.8 is required. I used Python 3.9.10. Then run ./webui.sh. If you still get an error then manually download gfpgan using the following command: python3 -m pip install git+https://github.com/TencentARC/GFPGAN.git@8d2447a2d918f8eba5a4a01463fd48e45126a379 --prefer-binary It works for me. Please let me know if any issues.

NOTE: before changing Python version, don't forget to remove venv folder

I use python 3.10.6, and got this error

OSError: [Errno 66] Directory not empty: '/private/var/folders/nx/1cwr0jzj5hn0x2rg76zvdnf00000gn/T/pip-install-ksdv6m4b/basicsr_2d44756bcad64d9faa6f752dd4e274b2/.eggs/Cython-3.0.0-py3.10-macosx-10.9-universal2.egg/Cython-3.0.0.dist-info' -> '/private/var/folders/nx/1cwr0jzj5hn0x2rg76zvdnf00000gn/T/pip-install-ksdv6m4b/basicsr_2d44756bcad64d9faa6f752dd4e274b2/.eggs/Cython-3.0.0-py3.10-macosx-10.9-universal2.egg/EGG-INFO'

Trumming commented 12 months ago

Got same issue when using the pypi mirror source of https://pypi.tuna.tsinghua.edu.cn/simple (commonly used for china mainland users), the error is caused by a installable tb-nightly package could not been found in the mirror.

It may due to the tuna's pypi mirror source doesn't sync the tb-nightly packages. So if you could have some way to reach the official pypi mirror source, just switch back to it and every things will go right.

TL;DR + chinese translate: 如果你的pip用了清华的pypi镜像源,那可能是清华源的问题,换回官方源就正常了(如果你能访问)

也可以使用阿里源,我换阿里源问题解决了