dbr / tvnamer

Automatic TV episode file renamer, uses data from thetvdb.com via tvdb_api
https://pypi.python.org/pypi/tvnamer/
The Unlicense
907 stars 115 forks source link

tvnamer fails whenpython version changes in brew #198

Closed jkirklan closed 3 years ago

jkirklan commented 3 years ago

When I run tvnamer I get errors indicating that it can't find python libraries. I uninstall and reinstall and it works. It installs a newer version of python 3.9 with tvnamer. It seems like when they python version is upgraded the paths to it change and tvnamer can't access the files.

dbr commented 3 years ago

There isn't enough details to really know exactly what is causing this, but from what you say I can only assume it's either caused by:

  1. Homebrew tends to break pip install scripts when upgrading, depending on how the install is done (as the script genreated at head -1 $(which tvnamer) explicitly references the executable for a specific patch-version of Python)
  2. The error was ImportError: cannot import name '_to_bytes' - which was a problem with the underlying tvdb_api module, which was fixed not too long after it started breaking (so a reinstall would be fine)

If it is the first problem, the simplest solution is probably to use the tvnamer version packaged in Homebrew (i.e brew install tvnamer), and that should be automatically reinstalled when you upgrade Python. Other commonly suggested option for "brew upgrade breaks python"-related search is to use pyenv to managed Python versions instead of Homebrew, but that's more for development than installing tools)

The second point should already be fixed and shouldn't, hopefully, happen again!

Reopen if I am mistaken!