TailorDev / Watson

:watch: A wonderful CLI to track your time!
http://tailordev.github.io/Watson/
MIT License
2.41k stars 237 forks source link

Package metadata not found for td-watson #507

Closed NickRaleigh closed 2 months ago

NickRaleigh commented 2 months ago

Hi, I've been using watson for a few years on arch linux. I started getting the following error simply by running watson. I don't know if it's an AUR issue or something wrong with watson itself:

Traceback (most recent call last):
  File "/usr/lib/python3.12/importlib/metadata/__init__.py", line 397, in from_name
    return next(cls.discover(name=name))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
StopIteration

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/watson", line 33, in <module>
    sys.exit(load_entry_point('td-watson==2.1.0', 'console_scripts', 'watson')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/bin/watson", line 22, in importlib_load_entry_point
    for entry_point in distribution(dist_name).entry_points
                       ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/importlib/metadata/__init__.py", line 862, in distribution
    return Distribution.from_name(distribution_name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/importlib/metadata/__init__.py", line 399, in from_name
    raise PackageNotFoundError(name)
importlib.metadata.PackageNotFoundError: No package metadata was found for td-watson
jmaupetit commented 2 months ago

Hi @NickRaleigh :wave: You closed this issue. Should we understand that you fixed it? If so, how? Thank you for your answer.

NickRaleigh commented 2 months ago

@jmaupetit yes, I found a fix. It was related to an issue with archlinux's package manager. I'll leave the solution below in case another arch user runs into the same problem.

I installed watson with paru. I could fix the issue by doing the following things:

  1. Remove watson: paru -R watson
  2. Delete cache: rm -rf ~/.cache/paru/clone/watson
  3. Reinstall watson: paru watson
jmaupetit commented 1 month ago

I just encountered the same issue with Manjaro. I use yay package manager, but the idea is sensibly the same: uninstall watson, re-install it, and enjoy :tada: