ehristoforu / DeFooocus

Always focus on prompting and generating
GNU General Public License v3.0
209 stars 54 forks source link

[Bug]: ModuleNotFoundError: No module named 'rembg' #23

Open nitinmukesh opened 4 months ago

nitinmukesh commented 4 months ago

Prerequisites

Describe the problem

Server crashed with error

Full console log output

Already up-to-date
Update succeeded.
[System ARGV] ['DeFooocus\\entry_with_update.py', '--attention-split', '--in-browser', '--theme', 'dark']
Python 3.10.9 (tags/v3.10.9:1dd9be6, Dec  6 2022, 20:01:21) [MSC v.1934 64 bit (AMD64)]
Fooocus version: 0.2
Version mismatch for tqdm: Installed version 4.64.1 does not meet requirement tqdm==4.65.0
Installing requirements
Couldn't install requirements.
Command: "C:\tut\DeFooocus_win64_portable\python_embeded\python.exe" -m pip install -r "requirements_versions.txt" --prefer-binary
Error code: 2
stdout: Looking in indexes: https://pypi.org/simple, https://pypi.ngc.nvidia.com
Requirement already satisfied: torchsde==0.2.5 in c:\users\nitin\appdata\roaming\python\python310\site-packages (from -r requirements_versions.txt (line 1)) (0.2.5)
Requirement already satisfied: einops==0.4.1 in c:\tut\defooocus_win64_portable\python_embeded\lib\site-packages (from -r requirements_versions.txt (line 2)) (0.4.1)
Requirement already satisfied: transformers==4.30.2 in c:\tut\defooocus_win64_portable\python_embeded\lib\site-packages (from -r requirements_versions.txt (line 3)) (4.30.2)
Requirement already satisfied: safetensors==0.3.1 in c:\tut\defooocus_win64_portable\python_embeded\lib\site-packages (from -r requirements_versions.txt (line 4)) (0.3.1)
Requirement already satisfied: accelerate==0.21.0 in c:\tut\defooocus_win64_portable\python_embeded\lib\site-packages (from -r requirements_versions.txt (line 5)) (0.21.0)
Requirement already satisfied: pyyaml==6.0 in c:\tut\defooocus_win64_portable\python_embeded\lib\site-packages (from -r requirements_versions.txt (line 6)) (6.0)
Requirement already satisfied: Pillow==9.2.0 in c:\tut\defooocus_win64_portable\python_embeded\lib\site-packages (from -r requirements_versions.txt (line 7)) (9.2.0)
Requirement already satisfied: scipy==1.9.3 in c:\tut\defooocus_win64_portable\python_embeded\lib\site-packages (from -r requirements_versions.txt (line 8)) (1.9.3)
Collecting tqdm==4.65.0 (from -r requirements_versions.txt (line 9))
  Downloading tqdm-4.65.0-py3-none-any.whl.metadata (56 kB)
     ---------------------------------------- 57.0/57.0 kB ? eta 0:00:00
Requirement already satisfied: psutil==5.9.5 in c:\tut\defooocus_win64_portable\python_embeded\lib\site-packages (from -r requirements_versions.txt (line 10)) (5.9.5)
Requirement already satisfied: pytorch_lightning==1.9.4 in c:\tut\defooocus_win64_portable\python_embeded\lib\site-packages (from -r requirements_versions.txt (line 11)) (1.9.4)
Requirement already satisfied: omegaconf==2.2.3 in c:\tut\defooocus_win64_portable\python_embeded\lib\site-packages (from -r requirements_versions.txt (line 12)) (2.2.3)
Requirement already satisfied: gradio==3.41.2 in c:\tut\defooocus_win64_portable\python_embeded\lib\site-packages (from -r requirements_versions.txt (line 13)) (3.41.2)
Requirement already satisfied: pygit2==1.12.2 in c:\tut\defooocus_win64_portable\python_embeded\lib\site-packages (from -r requirements_versions.txt (line 14)) (1.12.2)
Requirement already satisfied: opencv-contrib-python==4.8.0.74 in c:\tut\defooocus_win64_portable\python_embeded\lib\site-packages (from -r requirements_versions.txt (line 15)) (4.8.0.74)
Collecting diffusers==0.25.1 (from -r requirements_versions.txt (line 16))
  Downloading diffusers-0.25.1-py3-none-any.whl.metadata (19 kB)
Requirement already satisfied: httpx==0.24.1 in c:\tut\defooocus_win64_portable\python_embeded\lib\site-packages (from -r requirements_versions.txt (line 17)) (0.24.1)
Requirement already satisfied: onnxruntime==1.16.3 in c:\tut\defooocus_win64_portable\python_embeded\lib\site-packages (from -r requirements_versions.txt (line 18)) (1.16.3)
Requirement already satisfied: timm==0.9.2 in c:\tut\defooocus_win64_portable\python_embeded\lib\site-packages (from -r requirements_versions.txt (line 19)) (0.9.2)
Collecting translators==5.8.9 (from -r requirements_versions.txt (line 20))
  Downloading translators-5.8.9-py3-none-any.whl.metadata (68 kB)
     ---------------------------------------- 68.5/68.5 kB ? eta 0:00:00
Collecting rembg==2.0.53 (from -r requirements_versions.txt (line 21))
  Downloading rembg-2.0.53-py3-none-any.whl.metadata (14 kB)
Collecting groundingdino-py==0.4.0 (from -r requirements_versions.txt (line 22))
  Downloading groundingdino-py-0.4.0.tar.gz (82 kB)
     ---------------------------------------- 82.3/82.3 kB ? eta 0:00:00
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'

stderr: ERROR: Exception:
Traceback (most recent call last):
  File "C:\Users\nitin\AppData\Roaming\Python\Python310\site-packages\pip\_vendor\pkg_resources\__init__.py", line 3070, in _dep_map
    return self.__dep_map
  File "C:\Users\nitin\AppData\Roaming\Python\Python310\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2863, in __getattr__
    raise AttributeError(attr)
AttributeError: _DistInfoDistribution__dep_map

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\nitin\AppData\Roaming\Python\Python310\site-packages\pip\_vendor\packaging\requirements.py", line 36, in __init__
    parsed = _parse_requirement(requirement_string)
  File "C:\Users\nitin\AppData\Roaming\Python\Python310\site-packages\pip\_vendor\packaging\_parser.py", line 62, in parse_requirement
    return _parse_requirement(Tokenizer(source, rules=DEFAULT_RULES))
  File "C:\Users\nitin\AppData\Roaming\Python\Python310\site-packages\pip\_vendor\packaging\_parser.py", line 80, in _parse_requirement
    url, specifier, marker = _parse_requirement_details(tokenizer)
  File "C:\Users\nitin\AppData\Roaming\Python\Python310\site-packages\pip\_vendor\packaging\_parser.py", line 118, in _parse_requirement_details
    specifier = _parse_specifier(tokenizer)
  File "C:\Users\nitin\AppData\Roaming\Python\Python310\site-packages\pip\_vendor\packaging\_parser.py", line 214, in _parse_specifier
    parsed_specifiers = _parse_version_many(tokenizer)
  File "C:\Users\nitin\AppData\Roaming\Python\Python310\site-packages\pip\_vendor\packaging\_parser.py", line 229, in _parse_version_many
    tokenizer.raise_syntax_error(
  File "C:\Users\nitin\AppData\Roaming\Python\Python310\site-packages\pip\_vendor\packaging\_tokenizer.py", line 167, in raise_syntax_error
    raise ParserSyntaxError(
pip._vendor.packaging._tokenizer.ParserSyntaxError: .* suffix can only be used with `==` or `!=` operators
    numpy (>=1.19.*) ; python_version >= "3.7"
           ~~~~~~~^

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

Traceback (most recent call last):
  File "C:\Users\nitin\AppData\Roaming\Python\Python310\site-packages\pip\_internal\cli\base_command.py", line 179, in exc_logging_wrapper
    status = run_func(*args)
  File "C:\Users\nitin\AppData\Roaming\Python\Python310\site-packages\pip\_internal\cli\req_command.py", line 67, in wrapper
    return func(self, options, args)
  File "C:\Users\nitin\AppData\Roaming\Python\Python310\site-packages\pip\_internal\commands\install.py", line 377, in run
    requirement_set = resolver.resolve(
  File "C:\Users\nitin\AppData\Roaming\Python\Python310\site-packages\pip\_internal\resolution\resolvelib\resolver.py", line 95, in resolve
    result = self._result = resolver.resolve(
  File "C:\Users\nitin\AppData\Roaming\Python\Python310\site-packages\pip\_vendor\resolvelib\resolvers.py", line 546, in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
  File "C:\Users\nitin\AppData\Roaming\Python\Python310\site-packages\pip\_vendor\resolvelib\resolvers.py", line 427, in resolve
    failure_causes = self._attempt_to_pin_criterion(name)
  File "C:\Users\nitin\AppData\Roaming\Python\Python310\site-packages\pip\_vendor\resolvelib\resolvers.py", line 239, in _attempt_to_pin_criterion
    criteria = self._get_updated_criteria(candidate)
  File "C:\Users\nitin\AppData\Roaming\Python\Python310\site-packages\pip\_vendor\resolvelib\resolvers.py", line 229, in _get_updated_criteria
    for requirement in self._p.get_dependencies(candidate=candidate):
  File "C:\Users\nitin\AppData\Roaming\Python\Python310\site-packages\pip\_internal\resolution\resolvelib\provider.py", line 247, in get_dependencies
    return [r for r in candidate.iter_dependencies(with_requires) if r is not None]
  File "C:\Users\nitin\AppData\Roaming\Python\Python310\site-packages\pip\_internal\resolution\resolvelib\provider.py", line 247, in <listcomp>
    return [r for r in candidate.iter_dependencies(with_requires) if r is not None]
  File "C:\Users\nitin\AppData\Roaming\Python\Python310\site-packages\pip\_internal\resolution\resolvelib\candidates.py", line 401, in iter_dependencies
    for r in self.dist.iter_dependencies():
  File "C:\Users\nitin\AppData\Roaming\Python\Python310\site-packages\pip\_internal\metadata\pkg_resources.py", line 247, in iter_dependencies
    return self._dist.requires(extras)
  File "C:\Users\nitin\AppData\Roaming\Python\Python310\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2786, in requires
    dm = self._dep_map
  File "C:\Users\nitin\AppData\Roaming\Python\Python310\site-packages\pip\_vendor\pkg_resources\__init__.py", line 3072, in _dep_map
    self.__dep_map = self._compute_dependencies()
  File "C:\Users\nitin\AppData\Roaming\Python\Python310\site-packages\pip\_vendor\pkg_resources\__init__.py", line 3082, in _compute_dependencies
    reqs.extend(parse_requirements(req))
  File "C:\Users\nitin\AppData\Roaming\Python\Python310\site-packages\pip\_vendor\pkg_resources\__init__.py", line 3135, in __init__
    super().__init__(requirement_string)
  File "C:\Users\nitin\AppData\Roaming\Python\Python310\site-packages\pip\_vendor\packaging\requirements.py", line 38, in __init__
    raise InvalidRequirement(str(e)) from e
pip._vendor.packaging.requirements.InvalidRequirement: .* suffix can only be used with `==` or `!=` operators
    numpy (>=1.19.*) ; python_version >= "3.7"
           ~~~~~~~^

CMD Failed requirements: install -r "requirements_versions.txt"
Downloading: "https://huggingface.co/lllyasviel/misc/resolve/main/xlvaeapp.pth" to C:\tut\DeFooocus_win64_portable\DeFooocus\models\vae_approx\xlvaeapp.pth

100%|███████████████████████████████████████████████████████████████████████████████| 209k/209k [00:00<00:00, 9.09MB/s]
Downloading: "https://huggingface.co/lllyasviel/misc/resolve/main/vaeapp_sd15.pt" to C:\tut\DeFooocus_win64_portable\DeFooocus\models\vae_approx\vaeapp_sd15.pth

100%|███████████████████████████████████████████████████████████████████████████████| 209k/209k [00:00<00:00, 9.68MB/s]
Downloading: "https://huggingface.co/lllyasviel/misc/resolve/main/xl-to-v1_interposer-v3.1.safetensors" to C:\tut\DeFooocus_win64_portable\DeFooocus\models\vae_approx\xl-to-v1_interposer-v3.1.safetensors

100%|█████████████████████████████████████████████████████████████████████████████| 6.25M/6.25M [00:00<00:00, 13.6MB/s]
Downloading: "https://huggingface.co/lllyasviel/misc/resolve/main/fooocus_expansion.bin" to C:\tut\DeFooocus_win64_portable\DeFooocus\models\prompt_expansion\fooocus_expansion\pytorch_model.bin

100%|███████████████████████████████████████████████████████████████████████████████| 335M/335M [00:27<00:00, 12.7MB/s]
Downloading: "https://huggingface.co/fluently/Fluently-XL-v4/resolve/main/FluentlyXL-v4.safetensors" to C:\tut\DeFooocus_win64_portable\DeFooocus\models\checkpoints\FluentlyXL-v4.safetensors

100%|█████████████████████████████████████████████████████████████████████████████| 6.62G/6.62G [09:24<00:00, 12.6MB/s]
Downloading: "https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/resolve/main/sd_xl_offset_example-lora_1.0.safetensors" to C:\tut\DeFooocus_win64_portable\DeFooocus\models\loras\sd_xl_offset_example-lora_1.0.safetensors

100%|█████████████████████████████████████████████████████████████████████████████| 47.3M/47.3M [00:03<00:00, 12.8MB/s]
Total VRAM 8188 MB, total RAM 16108 MB
Set vram state to: NORMAL_VRAM
Always offload VRAM
Device: cuda:0 NVIDIA GeForce RTX 4060 Laptop GPU : native
VAE dtype: torch.bfloat16
Using split optimization for cross attention
Refiner unloaded.
Traceback (most recent call last):
  File "C:\tut\DeFooocus_win64_portable\DeFooocus\entry_with_update.py", line 46, in <module>
    from launch import *
  File "C:\tut\DeFooocus_win64_portable\DeFooocus\launch.py", line 128, in <module>
    from webui import *
  File "C:\tut\DeFooocus_win64_portable\DeFooocus\webui.py", line 16, in <module>
    from modules.rembg import rembg_run
  File "C:\tut\DeFooocus_win64_portable\DeFooocus\modules\rembg.py", line 1, in <module>
    from rembg import remove
ModuleNotFoundError: No module named 'rembg'
Press any key to continue . . .

Version

Fooocus version: 0.2

Where are you running Fooocus?

Locally

Operating System

Windows 11

What browsers are you seeing the problem on?

Chrome

ehristoforu commented 3 months ago

Portable version?

xjapasnork commented 3 months ago

I also have the same problem

ehristoforu commented 3 months ago

I also have the same problem

You use portable version?

kamahn commented 1 month ago

I also have the same problem too. i use portable version (window11)

kamahn commented 1 month ago

Microsoft Windows [Version 10.0.22631.4169] (c) Microsoft Corporation. All rights reserved.

C:\AI\DeFooocus_win64_portable\python_embeded>python.exe -m pip install -r C:\AI\DeFooocus_win64_portable\DeFooocus-main\requirements_versions.txt Collecting torchsde==0.2.6 (from -r C:\AI\DeFooocus_win64_portable\DeFooocus-main\requirements_versions.txt (line 1)) Obtaining dependency information for torchsde==0.2.6 from https://files.pythonhosted.org/packages/dd/1f/b67ebd7e19ffe259f05d3cf4547326725c3113d640c277030be3e9998d6f/torchsde-0.2.6-py3-none-any.whl.metadata Using cached torchsde-0.2.6-py3-none-any.whl.metadata (5.3 kB) Requirement already satisfied: einops==0.4.1 in c:\ai\defooocus_win64_portable\python_embeded\lib\site-packages (from -r C:\AI\DeFooocus_win64_portable\DeFooocus-main\requirements_versions.txt (line 2)) (0.4.1) Requirement already satisfied: transformers==4.30.2 in c:\ai\defooocus_win64_portable\python_embeded\lib\site-packages (from -r C:\AI\DeFooocus_win64_portable\DeFooocus-main\requirements_versions.txt (line 3)) (4.30.2) Requirement already satisfied: safetensors==0.3.1 in c:\ai\defooocus_win64_portable\python_embeded\lib\site-packages (from -r C:\AI\DeFooocus_win64_portable\DeFooocus-main\requirements_versions.txt (line 4)) (0.3.1) Requirement already satisfied: accelerate==0.21.0 in c:\ai\defooocus_win64_portable\python_embeded\lib\site-packages (from -r C:\AI\DeFooocus_win64_portable\DeFooocus-main\requirements_versions.txt (line 5)) (0.21.0) Requirement already satisfied: pyyaml==6.0 in c:\ai\defooocus_win64_portable\python_embeded\lib\site-packages (from -r C:\AI\DeFooocus_win64_portable\DeFooocus-main\requirements_versions.txt (line 6)) (6.0) Requirement already satisfied: Pillow==9.2.0 in c:\ai\defooocus_win64_portable\python_embeded\lib\site-packages (from -r C:\AI\DeFooocus_win64_portable\DeFooocus-main\requirements_versions.txt (line 7)) (9.2.0) Requirement already satisfied: scipy==1.9.3 in c:\ai\defooocus_win64_portable\python_embeded\lib\site-packages (from -r C:\AI\DeFooocus_win64_portable\DeFooocus-main\requirements_versions.txt (line 8)) (1.9.3) Collecting tqdm==4.65.0 (from -r C:\AI\DeFooocus_win64_portable\DeFooocus-main\requirements_versions.txt (line 9)) Obtaining dependency information for tqdm==4.65.0 from https://files.pythonhosted.org/packages/e6/02/a2cff6306177ae6bc73bc0665065de51dfb3b9db7373e122e2735faf0d97/tqdm-4.65.0-py3-none-any.whl.metadata Using cached tqdm-4.65.0-py3-none-any.whl.metadata (56 kB) Requirement already satisfied: psutil==5.9.5 in c:\ai\defooocus_win64_portable\python_embeded\lib\site-packages (from -r C:\AI\DeFooocus_win64_portable\DeFooocus-main\requirements_versions.txt (line 10)) (5.9.5) Requirement already satisfied: pytorch_lightning==1.9.4 in c:\ai\defooocus_win64_portable\python_embeded\lib\site-packages (from -r C:\AI\DeFooocus_win64_portable\DeFooocus-main\requirements_versions.txt (line 11)) (1.9.4) Requirement already satisfied: omegaconf==2.2.3 in c:\ai\defooocus_win64_portable\python_embeded\lib\site-packages (from -r C:\AI\DeFooocus_win64_portable\DeFooocus-main\requirements_versions.txt (line 12)) (2.2.3) Requirement already satisfied: gradio==3.41.2 in c:\ai\defooocus_win64_portable\python_embeded\lib\site-packages (from -r C:\AI\DeFooocus_win64_portable\DeFooocus-main\requirements_versions.txt (line 13)) (3.41.2) Requirement already satisfied: pygit2==1.12.2 in c:\ai\defooocus_win64_portable\python_embeded\lib\site-packages (from -r C:\AI\DeFooocus_win64_portable\DeFooocus-main\requirements_versions.txt (line 14)) (1.12.2) Requirement already satisfied: opencv-contrib-python==4.8.0.74 in c:\ai\defooocus_win64_portable\python_embeded\lib\site-packages (from -r C:\AI\DeFooocus_win64_portable\DeFooocus-main\requirements_versions.txt (line 15)) (4.8.0.74) Collecting diffusers==0.25.1 (from -r C:\AI\DeFooocus_win64_portable\DeFooocus-main\requirements_versions.txt (line 16)) Obtaining dependency information for diffusers==0.25.1 from https://files.pythonhosted.org/packages/e4/c6/1f9768606c937e71c4d391307f395942c42d5567f538712dbf37b0cc0917/diffusers-0.25.1-py3-none-any.whl.metadata Using cached diffusers-0.25.1-py3-none-any.whl.metadata (19 kB) Requirement already satisfied: httpx==0.24.1 in c:\ai\defooocus_win64_portable\python_embeded\lib\site-packages (from -r C:\AI\DeFooocus_win64_portable\DeFooocus-main\requirements_versions.txt (line 17)) (0.24.1) Requirement already satisfied: onnxruntime==1.16.3 in c:\ai\defooocus_win64_portable\python_embeded\lib\site-packages (from -r C:\AI\DeFooocus_win64_portable\DeFooocus-main\requirements_versions.txt (line 18)) (1.16.3) Requirement already satisfied: timm==0.9.2 in c:\ai\defooocus_win64_portable\python_embeded\lib\site-packages (from -r C:\AI\DeFooocus_win64_portable\DeFooocus-main\requirements_versions.txt (line 19)) (0.9.2) Collecting translators==5.8.9 (from -r C:\AI\DeFooocus_win64_portable\DeFooocus-main\requirements_versions.txt (line 20)) Obtaining dependency information for translators==5.8.9 from https://files.pythonhosted.org/packages/25/68/9334a80ec0f54b294f1f4dee50494e6a21c5badc1a8e11270037bc177d88/translators-5.8.9-py3-none-any.whl.metadata Using cached translators-5.8.9-py3-none-any.whl.metadata (68 kB) Collecting rembg==2.0.53 (from -r C:\AI\DeFooocus_win64_portable\DeFooocus-main\requirements_versions.txt (line 21)) Obtaining dependency information for rembg==2.0.53 from https://files.pythonhosted.org/packages/55/6e/5a336d1308105fbe2a9738e7b99e79549628e80595d62142c4334e319b67/rembg-2.0.53-py3-none-any.whl.metadata Using cached rembg-2.0.53-py3-none-any.whl.metadata (14 kB) Collecting groundingdino-py==0.4.0 (from -r C:\AI\DeFooocus_win64_portable\DeFooocus-main\requirements_versions.txt (line 22)) Using cached groundingdino-py-0.4.0.tar.gz (82 kB) Preparing metadata (setup.py) ... error error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully. │ exit code: 1 ╰─> [6 lines of output] Traceback (most recent call last): File "", line 2, in File "", line 34, in File "C:\Users\lb_ai\AppData\Local\Temp\pip-install-pbn53v28\groundingdino-py_74b36d55c1db45c3bdf24c7fc21bf85c\setup.py", line 41, in readme = readme_file.read() UnicodeDecodeError: 'cp949' codec can't decode byte 0xf0 in position 2876: illegal multibyte sequence [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.

[notice] A new release of pip is available: 23.2.1 -> 24.2 [notice] To update, run: python.exe -m pip install --upgrade pip

C:\AI\DeFooocus_win64_portable\python_embeded>