lllyasviel / Fooocus

Focus on prompting and generating
GNU General Public License v3.0
41.49k stars 5.9k forks source link

Unable to Download Files on First Start @Windows 10 #2062

Closed dans0r closed 9 months ago

dans0r commented 9 months ago

Read Troubleshoot

[x] I admit that I have read the Troubleshoot before making this issue. Yes, and I created SWAP on mentioned SSD Disc. Min size 41000 MB and restartet. Still same Error.

Describe the problem When I run "run.bat" I get the following log.

Full Console Log

G:\Fooocus>.\python_embeded\python.exe -s Fooocus\entry_with_update.py
Already up-to-date
Update succeeded.
[System ARGV] ['Fooocus\\entry_with_update.py']
Traceback (most recent call last):
  File "G:\Fooocus\Fooocus\entry_with_update.py", line 46, in <module>
    from launch import *
  File "G:\Fooocus\Fooocus\launch.py", line 24, in <module>
    from modules.config import path_checkpoints, path_loras, path_vae_approx, path_fooocus_expansion, \
  File "G:\Fooocus\Fooocus\modules\config.py", line 7, in <module>
    import modules.sdxl_styles
  File "G:\Fooocus\Fooocus\modules\sdxl_styles.py", line 5, in <module>
    from modules.util import get_files_from_folder
  File "G:\Fooocus\Fooocus\modules\util.py", line 6, in <module>
    import cv2
  File "G:\Fooocus\python_embeded\lib\site-packages\cv2\__init__.py", line 181, in <module>
    bootstrap()
  File "G:\Fooocus\python_embeded\lib\site-packages\cv2\__init__.py", line 153, in bootstrap
    native_module = importlib.import_module("cv2")
  File "importlib\__init__.py", line 126, in import_module
    if sys.path[0] == BASE_DIR or os.path.realpath(sys.path[0]) == BASE_DIR:
ImportError: DLL load failed while importing cv2: Das angegebene Modul wurde nicht gefunden.

G:\Fooocus>pause
Drücken Sie eine beliebige Taste . . .

I don't know what to do or what to modify. First time ever trying to use some graphical ai software. Downloaded the actual 7z File from here.

mashb1t commented 9 months ago

There must have been some issue when downloading the necessary python packages. Please run .\python_embeded\python.exe -m pip install opencv-contrib-python and check again, should solve the issue.

dans0r commented 9 months ago

Thanks for the Info, but still the same.

Also had to update pip:

G:\Fooocus\python_embeded>python.exe -m pip install opencv-contrib-python
Requirement already satisfied: opencv-contrib-python in g:\fooocus\python_embeded\lib\site-packages (4.8.0.74)
Requirement already satisfied: numpy>=1.21.2 in g:\fooocus\python_embeded\lib\site-packages (from opencv-contrib-python) (1.23.5)
DEPRECATION: torchsde 0.2.5 has a non-standard dependency specifier numpy>=1.19.*; python_version >= "3.7". pip 23.3 will enforce this behaviour change. A possible replacement is to upgrade to a newer version of torchsde or contact the author to suggest that they release a version with a conforming dependency specifiers. Discussion can be found at https://github.com/pypa/pip/issues/12063

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

G:\Fooocus\python_embeded>python.exe -m pip install --upgrade pip
Requirement already satisfied: pip in g:\fooocus\python_embeded\lib\site-packages (23.2.1)
Collecting pip
  Obtaining dependency information for pip from https://files.pythonhosted.org/packages/15/aa/3f4c7bcee2057a76562a5b33ecbd199be08cdb4443a02e26bd2c3cf6fc39/pip-23.3.2-py3-none-any.whl.metadata
  Downloading pip-23.3.2-py3-none-any.whl.metadata (3.5 kB)
Downloading pip-23.3.2-py3-none-any.whl (2.1 MB)
   ---------------------------------------- 2.1/2.1 MB 8.4 MB/s eta 0:00:00
DEPRECATION: torchsde 0.2.5 has a non-standard dependency specifier numpy>=1.19.*; python_version >= "3.7". pip 23.3 will enforce this behaviour change. A possible replacement is to upgrade to a newer version of torchsde or contact the author to suggest that they release a version with a conforming dependency specifiers. Discussion can be found at https://github.com/pypa/pip/issues/12063
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 23.2.1
    Uninstalling pip-23.2.1:
      Successfully uninstalled pip-23.2.1
  WARNING: The scripts pip.exe, pip3.10.exe and pip3.exe are installed in 'G:\Fooocus\python_embeded\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed pip-23.3.2

G:\Fooocus\python_embeded>python.exe -m pip install opencv-contrib-python
Requirement already satisfied: opencv-contrib-python in g:\fooocus\python_embeded\lib\site-packages (4.8.0.74)
Requirement already satisfied: numpy>=1.21.2 in g:\fooocus\python_embeded\lib\site-packages (from opencv-contrib-python) (1.23.5)
DEPRECATION: torchsde 0.2.5 has a non-standard dependency specifier numpy>=1.19.*; python_version >= "3.7". pip 24.0 will enforce this behaviour change. A possible replacement is to upgrade to a newer version of torchsde or contact the author to suggest that they release a version with a conforming dependency specifiers. Discussion can be found at https://github.com/pypa/pip/issues/12063
mashb1t commented 9 months ago

This is not the same at all, now numpy is the issue ^^ Please make sure you're using the Fooocus python venv when installing the packages as they get installed to your system packages without that. To do so, please execute .\python_embeded\python.exe .\python_embeded\Scripts\activate first before executing .\python_embeded\python.exe -m pip install -r requirements_versions.txt or installing missing dependencies of yours.

dans0r commented 9 months ago

Nope. Still the same :(

mashb1t commented 9 months ago

I mean, you now have to iterate and install the missing packages either one by one or setup Fooocus again from the zip file. Just tested again, works just fine for me. We may also exercise this now package by package, but basically the output tells you which package is missing. The important thing is that you must not use python.exe as this is probably mapped to your system python, always use the explicit path to the embedded python.

dans0r commented 9 months ago

Yeah I understood but this is the first time ever using Fooocus. Downloaded the official .7z from here and started from zero. There is no python on my machine, only the unpacked one in \python_embeded\

What do you mean exactly by: .\python_embeded\python.exe .\python_embeded\Scripts\activate ? There is no activate in the subfolder Scripts. I'm a real noob in such things and starting from nothing.

Edit:

G:\Fooocus\python_embeded>python.exe -m pip install -r requirements_versions.txt
ERROR: Could not open requirements file: [Errno 2] No such file or directory: 'requirements_versions.txt'
mashb1t commented 9 months ago

I'm sorry, it is .\python_embeded\python.exe -m pip install -r .\Fooocus\requirements_versions.txt. You can install specific packages such as the missing opencv-contrib-python with .\python_embeded\python.exe -m pip install opencv-contrib-python. Depending on the output you might take additional steps.

dans0r commented 9 months ago

Hey, thanks again for helping.

Ran the code and the Output is:

torchsde==0.2.5
einops==0.4.1
transformers==4.30.2
safetensors==0.3.1
accelerate==0.21.0
pyyaml==6.0
Pillow==9.2.0
scipy==1.9.3
tqdm==4.64.1
psutil==5.9.5
pytorch_lightning==1.9.4
omegaconf==2.2.3
gradio==3.41.2
pygit2==1.12.2
opencv-contrib-python==4.8.0.74
httpx==0.24.1
onnxruntime==1.16.3
timm==0.9.2

When I run run.bat still the same as in the beginning.

mashb1t commented 9 months ago

your package might just be corrupt, feel free to run pip install again after removing cv2 from .\python_embeded\lib\site-packages. What is the exact error when executing run.bat again?

dans0r commented 9 months ago

The same as in the beginning post.

mashb1t commented 9 months ago

Maybe somebody else can support here.

As mentioned,

your package might just be corrupt, feel free to run pip install again after removing cv2 from .\python_embeded\lib\site-packages.

sadluck commented 9 months ago

Getting "ImportError: DLL load failed while importing _multiarray_umath" here as well after unpacking the 7z and running any of the .bat files. Both in windows directly and in conda. The proposed commands return satisfied requirements for all packages.

markmghali commented 9 months ago

I am having a similar error in a Linux LXC debain12 also very new to all this:

image

mashb1t commented 9 months ago

@markmghali same to you, make sure opencv-contrib-python is installed. Please run pip install -r requirements_versions.txt and check the results.

markmghali commented 9 months ago

@markmghali same to you, make sure opencv-contrib-python is installed. Please run pip install -r requirements_versions.txt and check the results.

yes appears to be installed

edit: thank you for the quick response!

image

also see this at the end:

image

dans0r commented 9 months ago

In case of the tourchsde warn, you have to got to: \python_embeded\Lib\site-packages\torchsde-0.2.5.dist-info and edit METADATA. In line 18 you have to remove " .* " at the end of 1.19. I think this is because in this scenario we're running a higher version.

But as @markmghali just mentioned, the same in my setup. Everything just fine and installed ... :(

markmghali commented 9 months ago

also having the same issue on a brand new fresh Ubuntu LXC

image

markmghali commented 9 months ago

to be clear I have no GPU in this system, its dual xeon 48 core cpu with 96GB of DDR4 RAM. tried re-setting this up multiple times. with no success. not sure what I am doing wrong. I was able to setup textgen-webui just fine (I know it is different).

mashb1t commented 9 months ago

@markmghali if this is the case please use the arg --always-cpu in your run.bat and test again.

markmghali commented 9 months ago

ok still same error:

(fooocus) root@Fooocus:~/Fooocus# python entry_with_update.py --listen --always-cpu
Already up-to-date
Update succeeded.
[System ARGV] ['entry_with_update.py', '--listen', '--always-cpu']
Traceback (most recent call last):
  File "/root/Fooocus/entry_with_update.py", line 46, in <module>
    from launch import *
  File "/root/Fooocus/launch.py", line 24, in <module>
    from modules import config
  File "/root/Fooocus/modules/config.py", line 7, in <module>
    import modules.sdxl_styles
  File "/root/Fooocus/modules/sdxl_styles.py", line 5, in <module>
    from modules.util import get_files_from_folder
  File "/root/Fooocus/modules/util.py", line 6, in <module>
    import cv2
  File "/root/anaconda3/envs/fooocus/lib/python3.10/site-packages/cv2/__init__.py", line 181, in <module>
    bootstrap()
  File "/root/anaconda3/envs/fooocus/lib/python3.10/site-packages/cv2/__init__.py", line 153, in bootstrap
    native_module = importlib.import_module("cv2")
  File "/root/anaconda3/envs/fooocus/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
(fooocus) root@Fooocus:~/Fooocus# 
sadluck commented 9 months ago

Getting "ImportError: DLL load failed while importing _multiarray_umath" here as well after unpacking the 7z and running any of the .bat files. Both in windows directly and in conda. The proposed commands return satisfied requirements for all packages.

My problem was actually solved by manually re-downloading the 7z. Initially, I downloaded & exctracted it via jdownloader, which probably messed it up in some way.

markmghali commented 9 months ago

very odd in a full fedora VM I have the install worked just fine

image

markmghali commented 9 months ago

I was also able to get this working on a fedora LXC

image

mashb1t commented 9 months ago

I assume that somehow the DLL is messed up on your PC, please check if redownloading works on Windows. If not you'll have to dig deeper and check the code in this place and why exactly this dll isn't there.

dans0r commented 9 months ago

Redownloading did not work for me. Still the same ImportError

mashb1t commented 9 months ago

The issue seems pretty straight forward to me, you're missing a file. Please recreate your venv and start from scratch. As you've already tried that please check your firewall/antivirus for hints and to trace down any involvement of them into file deletion.

vanderheyde commented 9 months ago

I experienced the same issue on Windows 10; it was resolved by installing the windows media feature pack in windows settings > apps > optional features > add a feature > Media Feature Pack

Everything worked after rebooting.

Hernan-V commented 9 months ago

I experienced the same issue on Windows 10; it was resolved by installing the windows media feature pack in windows settings > apps > optional features > add a feature > Media Feature Pack

Everything worked after rebooting.

This was the solution for me. Take this into account for the Windows "N" european version. The Add feature sometimes does not work from the System, so if you get an installation error also try from Powershell: DISM /Online /Add-Capability /CapabilityName:Media.MediaFeaturePack~~~~0.0.1.0

dans0r commented 9 months ago

I experienced the same issue on Windows 10; it was resolved by installing the windows media feature pack in windows settings > apps > optional features > add a feature > Media Feature Pack

Everything worked after rebooting.

This was the solution for me. Thanks for this an closed ;)