mrhan1993 / FooocusAPI

Fooocus with fastapi
https://mrhan1993.github.io/docs
GNU General Public License v3.0
17 stars 4 forks source link

Instaling on Ubuntu 24.04 #21

Closed tux- closed 1 month ago

tux- commented 2 months ago

Checklist

What happened?

Installing on Ubuntu 24.04 gives errors when running pip install -r requirements_versions.txt

Steps to reproduce the problem

git clone https://github.com/mrhan1993/FooocusAPI.git cd FooocusAPI python3 -m venv fooocus_env source fooocus_env/bin/activate pip install -r requirements_versions.txt

What should have happened?

Should install.

What browsers do you use to access Fooocus?

No response

Where are you running Fooocus?

Locally

What operating system are you using?

Ubuntu 24.04

Console logs

Collecting pyyaml==6.0 (from -r requirements_versions.txt (line 6))
  Using cached PyYAML-6.0.tar.gz (124 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1

Additional information

Modifying the file to have this contents, and it works:

torchsde
einops
transformers
safetensors
accelerate
pyyaml
Pillow
scipy
tqdm
psutil
pytorch_lightning
omegaconf
gradio==3.41.2
pygit2
opencv-contrib-python
onnxruntime
timm
sse_starlette
sqlalchemy
httpx
mrhan1993 commented 2 months ago

Since your output contains Using cached PyYAML-6.0.tar.gz, I suggest you execute pip cache purge first and try again

图片

tux- commented 1 month ago

In the current main branch requirements_versions.txt it does say to use PyYAML-6.0. If I change just that one to say PyYAML-6.0.1 and try, new bugs appear. This is in fresh install of Ubuntu 24.04. Tried it on two different VM's and it is exactly same problem. After pip cache purge problem persists as well.

mrhan1993 commented 1 month ago

Sorry, my fault. I tested in 22.04. I will check it now

mrhan1993 commented 1 month ago

I'm sure this issue is caused by the version of Python, and the default Python version for Ubuntu 24.04 is 3.12. I would recommend that you use Python 3.10 as the running environment for the Fooocus API, or you can follow the requirements you mentioned above to remove the version number, but this has not been fully tested. In order to be consistent with Fooocus, it will not be merged into the mainline.

tux- commented 1 month ago

Yeah, looks like Fooocus has the same issue. I have no clue how to install different Python versions. How ever, I do know that using the above posted txt file, make it all run without issues. So, I guess this is more like a guide on how to make it work out of the box on Ubuntu 24.04. Maybe it should have been a wiki post instead or something, not sure if you want to enable wiki tho.