lllyasviel / Fooocus

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

Linux Mint 22 Compatibility Issues #3535

Closed Majoraslayer closed 2 weeks ago

Majoraslayer commented 4 weeks ago

Checklist

What happened?

I'm trying to install on Linux Mint 22, which ships with Python 3.12.3. By default, this means pip is disabled from installing anything. The install guide doesn't cover this issue, but a workaround is to run:

sudo mv /usr/lib/python3.12/EXTERNALLY-MANAGED /usr/lib/python3.12/EXTERNALLY-MANAGED.old

This fixes pip/pip3. However, once setup completes, when I try to run Fooocus I get the following error:

Fooocus version: 2.5.5
Installing torch and torchvision
WARNING: Skipping /usr/lib/python3.12/dist-packages/argcomplete-3.1.4.dist-info due to invalid metadata entry 'name'
Looking in indexes: https://pypi.org/simple, https://download.pytorch.org/whl/cu121
ERROR: Could not find a version that satisfies the requirement torch==2.1.0 (from versions: 2.2.0, 2.2.0+cu121, 2.2.1, 2.2.1+cu121, 2.2.2, 2.2.2+cu121, 2.3.0, 2.3.0+cu121, 2.3.1, 2.3.1+cu121, 2.4.0, 2.4.0+cu121)
ERROR: No matching distribution found for torch==2.1.0
Traceback (most recent call last):
  File "/home/majoraslayer/Installers/Fooocus/entry_with_update.py", line 46, in <module>
    from launch import *
  File "/home/majoraslayer/Installers/Fooocus/launch.py", line 75, in <module>
    prepare_environment()
  File "/home/majoraslayer/Installers/Fooocus/launch.py", line 39, in prepare_environment
    run(f'"{python}" -m {torch_command}', "Installing torch and torchvision", "Couldn't install torch", live=True)
  File "/home/majoraslayer/Installers/Fooocus/modules/launch_util.py", line 62, in run
    raise RuntimeError("\n".join(error_bits))
RuntimeError: Couldn't install torch.
Command: "/usr/bin/python3" -m pip install torch==2.1.0 torchvision==0.16.0 --extra-index-url https://download.pytorch.org/whl/cu121
Error code: 1

It appears whatever version of Torch is required is not readily available for an unmodified install of Linux Mint 22, essentially meaning there's an incompatibility out of the box.

Steps to reproduce the problem

  1. Install Fooocus per the README install guide on Linux Mint 22.
  2. Attempt to execute entry_with_update.py per the guide.
  3. Cry softly into pillow.

What should have happened?

The required version of Torch should have been able to install, then the script should have continued to execute correctly so that Fooocus would be available for use.

What browsers do you use to access Fooocus?

Mozilla Firefox, Google Chrome

Where are you running Fooocus?

Locally

What operating system are you using?

Linux Mint 22

Console logs

Update failed.
No module named 'pygit2'
Update succeeded.
[System ARGV] ['Fooocus/entry_with_update.py', '--theme', 'dark', '--output-path', '/mnt/My Files/Pictures/Focus', '--disable-in-browser', '--listen']
/home/majoraslayer/Installers/Fooocus/build_launcher.py:8: SyntaxWarning: invalid escape sequence '\p'
  win32_cmd = '''
Python 3.12.3 (main, Jul 31 2024, 17:43:48) [GCC 13.2.0]
Fooocus version: 2.5.5
Installing torch and torchvision
WARNING: Skipping /usr/lib/python3.12/dist-packages/argcomplete-3.1.4.dist-info due to invalid metadata entry 'name'
Looking in indexes: https://pypi.org/simple, https://download.pytorch.org/whl/cu121
ERROR: Could not find a version that satisfies the requirement torch==2.1.0 (from versions: 2.2.0, 2.2.0+cu121, 2.2.1, 2.2.1+cu121, 2.2.2, 2.2.2+cu121, 2.3.0, 2.3.0+cu121, 2.3.1, 2.3.1+cu121, 2.4.0, 2.4.0+cu121)
ERROR: No matching distribution found for torch==2.1.0
Traceback (most recent call last):
  File "/home/majoraslayer/Installers/Fooocus/entry_with_update.py", line 46, in <module>
    from launch import *
  File "/home/majoraslayer/Installers/Fooocus/launch.py", line 75, in <module>
    prepare_environment()
  File "/home/majoraslayer/Installers/Fooocus/launch.py", line 39, in prepare_environment
    run(f'"{python}" -m {torch_command}', "Installing torch and torchvision", "Couldn't install torch", live=True)
  File "/home/majoraslayer/Installers/Fooocus/modules/launch_util.py", line 62, in run
    raise RuntimeError("\n".join(error_bits))
RuntimeError: Couldn't install torch.
Command: "/usr/bin/python3" -m pip install torch==2.1.0 torchvision==0.16.0 --extra-index-url https://download.pytorch.org/whl/cu121
Error code: 1

Additional information

No response

IPv6 commented 3 weeks ago

Why not use conda? afaik Fooocus is tied to Python 3.10

Majoraslayer commented 3 weeks ago

I tried installing Anaconda, but some of the listed pre-requisites either weren't available to install or caused conflicts with sound libraries. I was able to install Miniconda, but that method still ran into the same issue with pytorch when trying to execute Fooocus.

IPv6 commented 3 weeks ago

It seems that the problem is in combination of linux version, python version and hardware details, "No matching distribution found for torch" means that. You'd better find how to install torch for your situation at torch support forums (imho it is not purely a Mint issue, its just linux). Fooocus don`t do anything spicy here, it just need torch to be installed. May be there are custom distributions/repos or something like that.

daedon commented 2 weeks ago

I've been using Fooocus on Mint with XFCE for 4 months, zero problems.

Majoraslayer commented 2 weeks ago

I've been using Fooocus on Mint with XFCE for 4 months, zero problems.

Mint 22 just released last month, did you upgrade to the latest version?

daedon commented 2 weeks ago

No. I'm running Mint 21.3 with all the updates but I haven't done an upgrade.

Python 3.10.12 Fooocus version: 2.5.5 same as yours

My hardware is an MSI Aegis i7 137000F, 64G Ram, NVIDIA GeForce RTX 4060 8G A 1Tb SSD with Windows and a 4Tb SSD with Mint that runs the same software 5 to 10 times faster than on the Windows SSD.

Aside from power outages, Fooocus has been running 24/7 with no problems.

I'm relatively new to this, not sure it's Linux version related.

On Sun, Aug 25, 2024 at 5:38 PM Majoraslayer @.***> wrote:

I've been using Fooocus on Mint with XFCE for 4 months, zero problems.

Mint 22 just released last month, did you upgrade to the latest version?

— Reply to this email directly, view it on GitHub https://github.com/lllyasviel/Fooocus/issues/3535#issuecomment-2309003875, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZQBNL2L24R2NQE3L4373TZTJFHDAVCNFSM6AAAAABMURHTOSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBZGAYDGOBXGU . You are receiving this because you commented.Message ID: @.***>

-- Donald Edward

This message is solely for the intended recipient and may contain confidential or privileged information. If you are not the intended recipient, any disclosure, copying, use, or distribution of the information included in this message is prohibited. If you have received this communication in error, please notify and immediately and permanently delete this message and any attachments. Thank you.

Majoraslayer commented 2 weeks ago

No. I'm running Mint 21.3 with all the updates but I haven't done an upgrade. Python 3.10.12 Fooocus version: 2.5.5 same as yours My hardware is an MSI Aegis i7 137000F, 64G Ram, NVIDIA GeForce RTX 4060 8G A 1Tb SSD with Windows and a 4Tb SSD with Mint that runs the same software 5 to 10 times faster than on the Windows SSD. Aside from power outages, Fooocus has been running 24/7 with no problems. I'm relatively new to this, not sure it's Linux version related.

It's been a few days since I dug into it, but if I remember correctly, I believe the dead end I came to involved a dependency on the libasound2 library. Mint 22 switches the audio backend from PulseAudio to Pipewire, and I suspect that may be causing conflicts with audio libraries that Python stuff like PyTorch look for and depend on. It's actually the second time I've encountered a problem in Mint 22 related to libasound2; the first was a dependency check with DaVinci Resolve, and trying to install it to fix it automatically uninstalled most of Cinnamon. If I remember, this specific issue causes problems with installing PyTorch, which means Fooocus can't run.

While it may be true that the finger can be pointed at PyTorch, Pipewire, or Linux Mint themselves, I reported this issue so the devs would be aware of it in case they want to develop a workaround fix or alternative way of doing things. It looks like Linux distros may be moving toward further adopting Pipewire, and if I'm right about that being the cause of problems with libasound2, it may be worth looking into. I've been running Fooocus in a Docker container from a dev who deleted their project and GitHub account, so it's no longer online with a maintainer. It would be great to see an OFFICIAL Docker image, or other self-contained alternative environment, as an officially supported install method. That's why I also opened a feature request to suggest it as a possible future-focused (no pun intended) solution to issues like these.

daedon commented 2 weeks ago

BTW:

On Sun, Aug 25, 2024 at 6:36 PM Majoraslayer @.***> wrote:

No. I'm running Mint 21.3 with all the updates but I haven't done an upgrade. Python 3.10.12 Fooocus version: 2.5.5 same as yours My hardware is an MSI Aegis i7 137000F, 64G Ram, NVIDIA GeForce RTX 4060 8G A 1Tb SSD with Windows and a 4Tb SSD with Mint that runs the same software 5 to 10 times faster than on the Windows SSD. Aside from power outages, Fooocus has been running 24/7 with no problems. I'm relatively new to this, not sure it's Linux version related.

It's been a few weeks since I dug into it, but if I remember correctly, I believe the dead end I came to involved a dependency on the libasound2 library. Mint 22 switches the audio backend from PulseAudio to Pipewire, and I suspect that may be causing conflicts with audio libraries that Python stuff like PyTorch look for and depend on. It's actually the second time I've encountered a problem in Mint 22 related to libasound2; the first was a dependency check with DaVinci Resolve, and trying to install it to fix it automatically uninstalled most of Cinnamon. If I remember, this specific issue causes problems with installing PyTorch, which means Fooocus can't run.

While it may be true that the finger can be pointed at PyTorch, Pipewire, or Linux Mint themselves, I reported this issue so the devs would be aware of it in case they want to develop a fix or alternative way of doing things. It looks like Linux distros may be moving toward further adopting Pipewire, and if I'm right about that being the cause of problems with libasound2, it may be worth looking into. I've been running Fooocus in a Docker container from a dev who deleted their project and GitHub account, so it's not longer online with a maintainer. It would be great to see an OFFICIAL Docker image, or other self-contained alternative environment, as an officially supported install method. That's why I also opened a feature request to suggest it as a possible future-focused (no pun intended) solution to issues like these.

— Reply to this email directly, view it on GitHub https://github.com/lllyasviel/Fooocus/issues/3535#issuecomment-2309021497, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZQBNP7DNXKMKFL45APKR3ZTJL7VAVCNFSM6AAAAABMURHTOSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBZGAZDCNBZG4 . You are receiving this because you commented.Message ID: @.***>

-- Donald Edward

This message is solely for the intended recipient and may contain confidential or privileged information. If you are not the intended recipient, any disclosure, copying, use, or distribution of the information included in this message is prohibited. If you have received this communication in error, please notify and immediately and permanently delete this message and any attachments. Thank you.

Majoraslayer commented 2 weeks ago

Update on this. I recently received an update for Python. Now the native Python install method halts at the following error instead:

ERROR: Cannot uninstall psutil 5.9.8, RECORD file not found. Hint: The package was installed by debian.

Trying to uninstall psutil with "apt remove python3-psutil" inexplicably tries to autoremove the entire Cinnamon desktop environment.

Majoraslayer commented 2 weeks ago

^ While the above issue still prevents the direct Python installation method from working on Mint 22, the recent repository update to my Python seems to have fixed some other issues. I tried the venv method again, and it now seems to work. Because of that, I'm going to go ahead and close this issue. If anyone else runs across these issues, it seems venv should be a good method to install on Mint 22 as of 8/28/2024.