vertaix / Vendi-Score

MIT License
97 stars 8 forks source link

Unable to install v0.0.3 on Colab #5

Closed dansitu closed 1 year ago

dansitu commented 1 year ago

Brilliant paper and library, thank you.

Installing on Colab, v0.0.3 fails due to an error and it has to fall back to v0.0.1:

WARNING: Generating metadata for package vendi_score produced metadata for project name unknown. Fix your #egg=vendi_score fragments.
Discarding https://files.pythonhosted.org/packages/7f/4c/ffff6368e4f13a17b8b65df59c868f6a2c8c9feadaaa203e7b6ac5e5f659/vendi-score-0.0.3.tar.gz#sha256=7b133fd293d63038aea032b2933c68a7040991ee91d9b953fb6b1ede43526c53 (from https://pypi.org/simple/vendi-score/) (requires-python:>=3.7): Requested unknown from https://files.pythonhosted.org/packages/7f/4c/ffff6368e4f13a17b8b65df59c868f6a2c8c9feadaaa203e7b6ac5e5f659/vendi-score-0.0.3.tar.gz#sha256=7b133fd293d63038aea032b2933c68a7040991ee91d9b953fb6b1ede43526c53 has inconsistent name: filename has 'vendi-score', but metadata has 'unknown'

Full log:

Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/
Collecting vendi_score[images]
  Downloading vendi-score-0.0.3.tar.gz (13 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
  WARNING: Generating metadata for package vendi_score produced metadata for project name unknown. Fix your #egg=vendi_score fragments.
Discarding https://files.pythonhosted.org/packages/7f/4c/ffff6368e4f13a17b8b65df59c868f6a2c8c9feadaaa203e7b6ac5e5f659/vendi-score-0.0.3.tar.gz#sha256=7b133fd293d63038aea032b2933c68a7040991ee91d9b953fb6b1ede43526c53 (from https://pypi.org/simple/vendi-score/) (requires-python:>=3.7): Requested unknown from https://files.pythonhosted.org/packages/7f/4c/ffff6368e4f13a17b8b65df59c868f6a2c8c9feadaaa203e7b6ac5e5f659/vendi-score-0.0.3.tar.gz#sha256=7b133fd293d63038aea032b2933c68a7040991ee91d9b953fb6b1ede43526c53 has inconsistent name: filename has 'vendi-score', but metadata has 'unknown'
  Downloading vendi_score-0.0.1-py3-none-any.whl (12 kB)
Requirement already satisfied: scipy>=1.3.2 in /usr/local/lib/python3.8/dist-packages (from vendi_score[images]) (1.7.3)
Collecting scikit-learn>=1.1
  Downloading scikit_learn-1.2.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (9.7 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 9.7/9.7 MB 61.0 MB/s eta 0:00:00
Requirement already satisfied: numpy>=1.14 in /usr/local/lib/python3.8/dist-packages (from vendi_score[images]) (1.21.6)
Requirement already satisfied: torchvision in /usr/local/lib/python3.8/dist-packages (from vendi_score[images]) (0.14.0+cu116)
Requirement already satisfied: torch in /usr/local/lib/python3.8/dist-packages (from vendi_score[images]) (1.13.0+cu116)
Requirement already satisfied: joblib>=1.1.1 in /usr/local/lib/python3.8/dist-packages (from scikit-learn>=1.1->vendi_score[images]) (1.2.0)
Requirement already satisfied: threadpoolctl>=2.0.0 in /usr/local/lib/python3.8/dist-packages (from scikit-learn>=1.1->vendi_score[images]) (3.1.0)
Requirement already satisfied: typing-extensions in /usr/local/lib/python3.8/dist-packages (from torch->vendi_score[images]) (4.4.0)
Requirement already satisfied: pillow!=8.3.*,>=5.3.0 in /usr/local/lib/python3.8/dist-packages (from torchvision->vendi_score[images]) (7.1.2)
Requirement already satisfied: requests in /usr/local/lib/python3.8/dist-packages (from torchvision->vendi_score[images]) (2.25.1)
Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.8/dist-packages (from requests->torchvision->vendi_score[images]) (2.10)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.8/dist-packages (from requests->torchvision->vendi_score[images]) (2022.12.7)
Requirement already satisfied: chardet<5,>=3.0.2 in /usr/local/lib/python3.8/dist-packages (from requests->torchvision->vendi_score[images]) (4.0.0)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.8/dist-packages (from requests->torchvision->vendi_score[images]) (1.24.3)
Installing collected packages: scikit-learn, vendi_score
  Attempting uninstall: scikit-learn
    Found existing installation: scikit-learn 1.0.2
    Uninstalling scikit-learn-1.0.2:
      Successfully uninstalled scikit-learn-1.0.2
Successfully installed scikit-learn-1.2.0 vendi_score-0.0.1
dansitu commented 1 year ago

I get the following error when attempting to install from the repo with pip install -e .

Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/
Obtaining file:///content/Vendi-Score
  Installing build dependencies ... done
  Checking if build backend supports build_editable ... done
ERROR: Project file:///content/Vendi-Score has a 'pyproject.toml' and its build backend is missing the 'build_editable' hook. Since it does not have a 'setup.py' nor a 'setup.cfg', it cannot be installed in editable mode. Consider using a build backend that supports PEP 660.
dansitu commented 1 year ago

And doing plain old pip install . gives this:

Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/
Processing /content/Vendi-Score
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: UNKNOWN
  Building wheel for UNKNOWN (pyproject.toml) ... done
  Created wheel for UNKNOWN: filename=UNKNOWN-0.0.0-py3-none-any.whl size=1797 sha256=5c50dc3fc939c0ebacf2a7a389695673a100c944d784f0110a8e5d522230f162
  Stored in directory: /root/.cache/pip/wheels/01/91/6a/3ab2cc71b65d9f94e2f845191a1183377f961c88c3116ad8d9
Successfully built UNKNOWN
Installing collected packages: UNKNOWN
  Attempting uninstall: UNKNOWN
    Found existing installation: UNKNOWN 0.0.0
    Uninstalling UNKNOWN-0.0.0:
      Successfully uninstalled UNKNOWN-0.0.0
Successfully installed UNKNOWN-0.0.0
dansitu commented 1 year ago

I'm able to pip install . after upgrading the local pip from 22.0.4 to 22.3.1.

dansitu commented 1 year ago

Yep, confirmed it all works as expected with pip 22.3.1 including pip install vendi_score.

adjidieng commented 1 year ago

Thank you! Glad it all worked out!