Fooocus icon indicating copy to clipboard operation
Fooocus copied to clipboard

ModuleNotFoundError: No module named 'packaging'

Open tkocou opened this issue 1 year ago • 2 comments

I tried running the webui.sh script (for installing in Linux) without installing from the requirements_versions.txt since Fooocus seems to be doing the heavy lifting in its code. From the console logging of a fresh installation of Fooocus: .... Successfully installed MarkupSafe-2.1.3 certifi-2023.7.22 charset-normalizer-3.3.0 filelock-3.12.4 fsspec-2023.9.2 idna-3.4 jinja2-3.1.2 mpmath-1.3.0 networkx-3.1 numpy-1.26.0 pillow-10.0.1 requests-2.31.0 sympy-1.12 torch-2.1.0+cu121 torchvision-0.16.0+cu121 triton-2.1.0 typing-extensions-4.8.0 urllib3-2.0.6 Traceback (most recent call last): File "/home/tko/Fooocus/entry_with_update.py", line 46, in from launch import * File "/home/tko/Fooocus/launch.py", line 89, in prepare_environment() File "/home/tko/Fooocus/launch.py", line 43, in prepare_environment if REINSTALL_ALL or not requirements_met(requirements_file): File "/home/tko/Fooocus/modules/launch_util.py", line 131, in requirements_met import packaging.version ModuleNotFoundError: No module named 'packaging'

Adding back to webui.sh, the pip install from requirements_versions.txt fixes the reported problem.

Secondary issue: Apparently the entry_with_update.py module is not accomplishing what I suppose it should be doing. Again from the console logging of a fresh installation of Fooocus: .... Update failed. authentication required but no callback set Update succeeded. ....

In entry_with_update.py, the block in try appears to error out and drops into the exception giving the output found in the console logging.

tkocou avatar Oct 11 '23 12:10 tkocou

The URL for the webui.sh script: https://github.com/tkocou/Fooocus4Linux

tkocou avatar Oct 11 '23 18:10 tkocou

@tkocou you seem to have accidentally made the url a link to a different url this one you can actually click: https://github.com/tkocou/Fooocus4Linux

moritztim avatar Dec 31 '23 00:12 moritztim

@mashb1t shouldn't this at least be added to the #1327 troubleshoot guide?

moritztim avatar Jan 02 '24 09:01 moritztim

Oh, sorry for not adding a comment. It seems like the packaging package is actually necessary as a precondition before running the entry_with_update.py as it is required for checking the package versions in requirements.txt. Please make sure to manually install it first. This package is bundled with the installer zip file for Windows, which is why it isn't a problem there.

pip3 install packaging
OR
apt install python3-packaging

authentication required but no callback set

This seems like you copied the ssh URL for git clone and you do not use a private/public key attached to your account + your target machine.

Both rather individual problems, please confirm both and let me know. We might consider adding the packaging package to the troubleshooting guide but as of until now nobody has reported this issue.

Thank you for your feedback!

mashb1t avatar Jan 02 '24 10:01 mashb1t

Please make sure to manually install it first.

If installing the requirements_versions.txt is a necessary step, I think it should be added to the install instructions

moritztim avatar Jan 02 '24 11:01 moritztim

@moritz-t-w i would agree with you, but this is not what i was saying. The package "packaging" has to be available first before Fooocus can do the auto-installation. @tkocou please check again with the information from https://github.com/lllyasviel/Fooocus/issues/646#issuecomment-1873851507

mashb1t avatar Jan 02 '24 11:01 mashb1t

Ok I see, and I checked, it is actually said in the install instructions to install the requirements. I didn't find anything about packaging tho

moritztim avatar Jan 02 '24 16:01 moritztim

Me neither, probably because we've never encountered that particular problem before.

mashb1t avatar Jan 02 '24 16:01 mashb1t