clikan icon indicating copy to clipboard operation
clikan copied to clipboard

[BUG]: `importlib.metadata` error in python 3.11.6

Open SeedyROM opened this issue 11 months ago • 5 comments

After running pip install clikan and executing the clikan command I get this error:

Traceback (most recent call last):
  File "/usr/local/bin/clikan", line 5, in <module>
    from clikan import clikan
  File "/usr/local/lib/python3.11/site-packages/clikan.py", line 15, in <module>
    VERSION = importlib.metadata.version('clikan')
              ^^^^^^^^^^^^^^^^^^
AttributeError: module 'importlib' has no attribute 'metadata'

SeedyROM avatar Mar 29 '24 05:03 SeedyROM

Ayup. Sorry, I borked it trying to resolve new PyPI and packaging shenanigans. I then made it worse in PyPi itself with ghost versions.

Unfortunately I don’t have time to figure it out, specifically the “test” garbage that would need to get setup in the GHA before actually deploying a new package.

Basically at some point setup.py fell out of favor and now there are multiple ways to do it, but none of them actually work as simply as it should be - to get the version from the file. I give up, waving the white flag. I will try and archive this bad version so at least the install works. But I’ve moved in to a Rust-based version of this utility.

On Fri, Mar 29, 2024 at 1:59 AM Zack Kollar @.***> wrote:

After running pip install clikan and executing the clikan command I get this error:

Traceback (most recent call last): File "/usr/local/bin/clikan", line 5, in from clikan import clikan File "/usr/local/lib/python3.11/site-packages/clikan.py", line 15, in VERSION = importlib.metadata.version('clikan') ^^^^^^^^^^^^^^^^^^ AttributeError: module 'importlib' has no attribute 'metadata'

— Reply to this email directly, view it on GitHub https://github.com/kitplummer/clikan/issues/72, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAABBGJRMIC3MHICIBMEJ2TY2T7M3AVCNFSM6AAAAABFN7A55WVHI2DSMVQWIX3LMV43ASLTON2WKOZSGIYTINZRGM2DINY . You are receiving this because you are subscribed to this thread.Message ID: @.***>

kitplummer avatar Mar 29 '24 12:03 kitplummer

But I’ve moved in to a Rust-based version of this utility.

If you could point me to that I'd love to check it out!

SeedyROM avatar Apr 03 '24 06:04 SeedyROM

https://github.com/kitplummer/cliban - note that it isn't as featured-up as this one. but works as a binary install.

On Wed, Apr 3, 2024 at 2:05 AM Zack Kollar @.***> wrote:

But I’ve moved in to a Rust-based version of this utility.

If you could point me to that I'd love to check it out!

— Reply to this email directly, view it on GitHub https://github.com/kitplummer/clikan/issues/72#issuecomment-2033628760, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAABBGJWXTF2SYW7NY2A3SDY3OLZDAVCNFSM6AAAAABFN7A55WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMZTGYZDQNZWGA . You are receiving this because you commented.Message ID: @.***>

kitplummer avatar Apr 03 '24 13:04 kitplummer

Hi Sorry to read this. I have enjoyed very much discovering clikan. Easy to use and a good way to learn a little python hacking it!!! Am I right in thinking that this means

  • no further development of clikan
  • existing working install is still good to use until something upstream breaks it
  • you are working on cliban which uses rust of which I know nothing :-) Thank you for work you have done here makes a really light solid useful app. Appreciated!

kevin-gwyrdh avatar Jul 21 '24 19:07 kevin-gwyrdh

not sure if this fixes the problem completely - but you can run it using this library: https://importlib-metadata.readthedocs.io/en/latest/

ref: https://stackoverflow.com/questions/59216175/importerror-cannot-import-name-metadata-from-importlib

tomcotter7 avatar Aug 13 '24 15:08 tomcotter7