Deployment fails without pip resolver or pip latest version

Hello all,

I have an issue deploying my space, it seems to be an issue with the pip resolver or not having pip latest version - for this space spaces/DataForGood/bechdelai-tool-image

ERROR: Exception:
Traceback (most recent call last):
  File "/home/user/.local/lib/python3.8/site-packages/pip/_internal/cli/base_command.py", line 165, in exc_logging_wrapper
    status = run_func(*args)
  File "/home/user/.local/lib/python3.8/site-packages/pip/_internal/cli/req_command.py", line 205, in wrapper
    return func(self, options, args)
  File "/home/user/.local/lib/python3.8/site-packages/pip/_internal/commands/install.py", line 389, in run
    to_install = resolver.get_installation_order(requirement_set)
  File "/home/user/.local/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 188, in get_installation_order
    weights = get_topological_weights(
  File "/home/user/.local/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 276, in get_topological_weights
    assert len(weights) == expected_node_count
AssertionError
WARNING: You are using pip version 22.0.2; however, version 22.3.1 is available.
You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.

--> ERROR: process "/bin/sh -c pip install -r requirements.txt" did not complete successfully: exit code: 2

Those topics were similar but without solutions

Also having the possibility to launch this command somewhere would probably solve it

pip install -r requirements.txt --use-deprecated=html5lib --use-deprecated=legacy-resolver

Thanks a lot for the help !
Theo

Hello, do someone has an idea ?
Maybe @XciD ?
Thanks a lot !
Theo

hi @DataForGood ,

Just sent you a PR that make it works. Your os call to upgrade pip is perfect, you just need to disabled the breaking requirement and also install it via os call.

os.system("pip install --upgrade pip")
os.system("pip install umap-learn bechdelai==0.0.1a2")

There was another minor issue with your Gradio outputs, switching the output components order make it work

return new_metrics, img_with_faces