Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: The wheel is invalid: invalid console script: 'main' - clippyx-0.1-py3-none-any.whl #19

Open
sammcj opened this issue Nov 18, 2024 · 9 comments

Comments

@sammcj
Copy link

sammcj commented Nov 18, 2024

Neat project!

When trying to install following the readme, Python errors out stating the wheel is invalid:

[main] ~/git/CLIPPyX $ uv venv; source .venv/bin/activate
Using Python 3.12.7 interpreter at: /Users/samm/.pyenv/versions/3.12.7/bin/python3
Creating virtualenv at: .venv

(CLIPPyX) [main] ~/git/CLIPPyX $ pip install -e . -U
using uv for pip...
   Built file:///Users/samm/git/CLIPPyX                                                                                                                                                       Built 1 editable in 458ms
Resolved 149 packages in 39ms
error: Failed to install: clippyx-0.1-py3-none-any.whl (clippyx==0.1 (from file:///Users/samm/git/CLIPPyX))
  Caused by: The wheel is invalid: invalid console script: 'main'

Interestingly running python setup.py install works, but then running the app crashes with:

CLIPPyX --settings
Traceback (most recent call last):
  File "/Users/samm/git/CLIPPyX/.venv/bin/CLIPPyX", line 33, in <module>
    sys.exit(load_entry_point('CLIPPyX==0.1', 'console_scripts', 'CLIPPyX')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/samm/git/CLIPPyX/.venv/bin/CLIPPyX", line 25, in importlib_load_entry_point
    return next(matches).load()
           ^^^^^^^^^^^^^^^^^^^^
  File "/Users/samm/.pyenv/versions/3.12.7/lib/python3.12/importlib/metadata/__init__.py", line 205, in load
    module = import_module(match.group('module'))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/samm/.pyenv/versions/3.12.7/lib/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1324, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'main'

And installing directly without a venv also fails:

ERROR: For req: CLIPPyX==0.1. Invalid script entry point: <ExportEntry CLIPPyX = main:None []> - A callable suffix is required. Cf https://packaging.python.org/specifications/entry-points/#use-for-scripts for more information.
  • Python 3.12.7
  • macOS 15.1
@jmtemmos
Copy link

Same error here :
ERROR: For req: CLIPPyX==0.1. Invalid script entry point: <ExportEntry CLIPPyX = main:None []> - A callable suffix is required.

@0ssamaak0
Copy link
Owner

Are u using conda or python venv?

@sammcj
Copy link
Author

sammcj commented Nov 18, 2024

Standard python venv, conda is too chonky for me.

@0ssamaak0
Copy link
Owner

can you run main.py?

@sammcj
Copy link
Author

sammcj commented Nov 19, 2024

No, it looks like main.py has errors where it's trying to use the old numpy (pre 2.0) methods:

(CLIPPyX) [main] ~/git/CLIPPyX $ python main.py
Traceback (most recent call last):
  File "/Users/samm/git/CLIPPyX/create_index.py", line 1, in <module>
    from Index.create_db import *
  File "/Users/samm/git/CLIPPyX/Index/create_db.py", line 1, in <module>
    import chromadb
  File "/Users/samm/git/CLIPPyX/.venv/lib/python3.12/site-packages/chromadb/__init__.py", line 3, in <module>
    from chromadb.api.client import Client as ClientCreator
  File "/Users/samm/git/CLIPPyX/.venv/lib/python3.12/site-packages/chromadb/api/__init__.py", line 7, in <module>
    from chromadb.api.models.Collection import Collection
  File "/Users/samm/git/CLIPPyX/.venv/lib/python3.12/site-packages/chromadb/api/models/Collection.py", line 7, in <module>
    import chromadb.utils.embedding_functions as ef
  File "/Users/samm/git/CLIPPyX/.venv/lib/python3.12/site-packages/chromadb/utils/embedding_functions.py", line 7, in <module>
    from chromadb.api.types import (
  File "/Users/samm/git/CLIPPyX/.venv/lib/python3.12/site-packages/chromadb/api/types.py", line 102, in <module>
    ImageDType = Union[np.uint, np.int_, np.float_]
                                         ^^^^^^^^^
  File "/Users/samm/git/CLIPPyX/.venv/lib/python3.12/site-packages/numpy/__init__.py", line 400, in __getattr__
    raise AttributeError(
AttributeError: `np.float_` was removed in the NumPy 2.0 release. Use `np.float64` instead.
Error running create_index.py: None
Traceback (most recent call last):
  File "/Users/samm/git/CLIPPyX/server.py", line 3, in <module>
    from Index.create_db import (
  File "/Users/samm/git/CLIPPyX/Index/create_db.py", line 1, in <module>
    import chromadb
  File "/Users/samm/git/CLIPPyX/.venv/lib/python3.12/site-packages/chromadb/__init__.py", line 3, in <module>
    from chromadb.api.client import Client as ClientCreator
  File "/Users/samm/git/CLIPPyX/.venv/lib/python3.12/site-packages/chromadb/api/__init__.py", line 7, in <module>
    from chromadb.api.models.Collection import Collection
  File "/Users/samm/git/CLIPPyX/.venv/lib/python3.12/site-packages/chromadb/api/models/Collection.py", line 7, in <module>
    import chromadb.utils.embedding_functions as ef
  File "/Users/samm/git/CLIPPyX/.venv/lib/python3.12/site-packages/chromadb/utils/embedding_functions.py", line 7, in <module>
    from chromadb.api.types import (
  File "/Users/samm/git/CLIPPyX/.venv/lib/python3.12/site-packages/chromadb/api/types.py", line 102, in <module>
    ImageDType = Union[np.uint, np.int_, np.float_]
                                         ^^^^^^^^^
  File "/Users/samm/git/CLIPPyX/.venv/lib/python3.12/site-packages/numpy/__init__.py", line 400, in __getattr__
    raise AttributeError(
AttributeError: `np.float_` was removed in the NumPy 2.0 release. Use `np.float64` instead.
Error running server.py: None

@0ssamaak0
Copy link
Owner

There are some issues due to version updates. I will update the requirements soon. Thank you for reporting this

@0ssamaak0
Copy link
Owner

Fixed in 1.0.1 Please verify it works without any issues! Thank you

@sammcj
Copy link
Author

sammcj commented Nov 26, 2024

Still seems broken:

git pull
pip install -e . -U
using uv for pip...
Using Python 3.12.7 environment at /Users/samm/.venv
Resolved 149 packages in 1.30s
   Built clippyx @ file:///Users/samm/git/CLIPPyX
Prepared 27 packages in 2.67s
Uninstalled 27 packages in 1.83s
error: Failed to install: clippyx-1.0.1-py3-none-any.whl (clippyx==1.0.1 (from file:///Users/samm/git/CLIPPyX))
  Caused by: The wheel is invalid: invalid console script: 'main'
python main.py
....
  File "/Users/samm/.venv/lib/python3.12/site-packages/doctr/models/utils/tensorflow.py", line 10, in <module>
    import tf2onnx
ModuleNotFoundError: No module named 'tf2onnx'
Error running server.py: None
pip install CLIPPyX
CLIPPyX
Traceback (most recent call last):
  File "/Users/samm/.venv/bin/clippyx", line 33, in <module>
    sys.exit(load_entry_point('CLIPPyX==1.0.1', 'console_scripts', 'CLIPPyX')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/samm/.venv/bin/clippyx", line 25, in importlib_load_entry_point
    return next(matches).load()
           ^^^^^^^^^^^^^^^^^^^^
  File "/Users/samm/.pyenv/versions/3.12.7/lib/python3.12/importlib/metadata/__init__.py", line 205, in load
    module = import_module(match.group('module'))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/samm/.pyenv/versions/3.12.7/lib/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1324, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'main'

@0ssamaak0
Copy link
Owner

I see the problem with doctr and it's trying to install the tf version. Can you try to install doctr independently?
Sorry for the late answer.

@0ssamaak0 0ssamaak0 reopened this Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants