rembg icon indicating copy to clipboard operation
rembg copied to clipboard

[BUG] Can't use python script in the command line

Open codedcosmos opened this issue 2 years ago • 1 comments

Describe the bug I am unable to use the program in it's most basic form.

To Reproduce Install remg and matplotlib

Run either of the above: rembg i /path/to/image_a.png /path/to/image_b.png rembg p /path/to/folder_a /path/to/folder_b

Expected behavior Images to be produced, instead I get the following error messages.

rembg: error: argument input: can't open 'i': [Errno 2] No such file or directory: 'i' rembg: error: argument input: can't open 'p': [Errno 2] No such file or directory: 'p'

OS Version: Arch Linux 5.18.14-arch1-1

Python: 3.10.5

Rembg version: I downloaded the latest one via pip

Additional context Have I missunderstood the documentation?

codedcosmos avatar Aug 01 '22 04:08 codedcosmos

NOW: Fri Aug 5 09:24:44 AM CST 2022 OS: Linux 5.15.57-2-MANJARO Python 3.10.5

Note the doc. https://github.com/danielgatis/rembg#installation

some library is not ready for python 3.10. e.g. onnxruntime https://pypi.org/project/onnxruntime/1.10.0/#files

you may install the version 1.0.x ( pip list |grep rembg)

here is my solution.

  1. download the source code git clone https://github.com/danielgatis/rembg.git
  2. cd rembg
  3. edit setup.py python_requires="~=3.9.0" --> python_requires=">=3.9.0",
  4. edit requirements.txt or requirements-gpu.txt onnxruntime==1.10.0 --> onnxruntime
  5. tar -zcf rembg.tar.gz *
  6. pip install rembg.tar.gz
  7. it works for me. PS. it may have a warning, but just a warning :D FYI.

lurenyang418 avatar Aug 05 '22 01:08 lurenyang418

Sorry for forgetting about this. Glad you closed it to clean up your issues list :)

codedcosmos avatar Oct 03 '22 07:10 codedcosmos