adamgot / python-plexlibrary

Create and maintain dynamic Plex libraries based on recipes.
BSD 3-Clause "New" or "Revised" License
203 stars 40 forks source link

AttributeError: module 'trakt.core' has no attribute 'pin_auth #74

Closed morganzero closed 4 years ago

morganzero commented 4 years ago

Hi! First off I wanna say Thanks for the script! Amazing job!

I've been running this script for a week and it has been working like a charm. But the for two days now I've been noticing that the libraries haven't changed at all, so I wanted to run the script manually to make sure everything was alright. And just what I was afraid of, it is having issues.

When running e.g: python3 plexlibrary movies_trendingor any recipe for that matter I get this error:

Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "plexlibrary/__main__.py", line 3, in <module>
    main()
  File "plexlibrary/plexlibrary.py", line 60, in main
    r = Recipe(args.recipe)
  File "plexlibrary/recipe.py", line 56, in __init__
    config=self.config)
  File "plexlibrary/traktutils.py", line 24, in __init__
    trakt.core.pin_auth(username, client_id=client_id,
AttributeError: module 'trakt.core' has no attribute 'pin_auth'

I've tried deleting the script and folder, I tried re-creating the Trakt API App. I have rebooted server. I have re-configured the config.yml and I just can't get the hang of it. I'm bascially out of ideas.

Any suggestions on what I can do more?

morganzero commented 4 years ago

Update

After uninstalling the requirements and re-installing them again I now get this error:

Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "plexlibrary/__main__.py", line 3, in <module>
    main()
  File "plexlibrary/plexlibrary.py", line 60, in main
    r = Recipe(args.recipe)
  File "plexlibrary/recipe.py", line 56, in __init__
    config=self.config)
  File "plexlibrary/traktutils.py", line 24, in __init__
    trakt.core.pin_auth(username, client_id=client_id,
AttributeError: module 'trakt' has no attribute 'core'
CoffeeKnyte commented 4 years ago

I am getting similar issues with using this script. I've also carried out similar trouble-shooting steps including:

Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "plexlibrary/__main__.py", line 8, in <module>
    main()
  File "plexlibrary/plexlibrary.py", line 66, in main
    r = Recipe(recipe_name=args.recipe, use_playlists=args.playlists)
  File "plexlibrary/recipe.py", line 64, in __init__
    config=self.config)
  File "plexlibrary/traktutils.py", line 25, in __init__
    trakt.core.pin_auth(username, client_id=client_id,
AttributeError: module 'trakt.core' has no attribute 'pin_auth'

What steps can I take?

@morganzero How did you solve this issue?

morganzero commented 4 years ago

I never did solve it. As long as I had Plex-Auto-Collection's requirements installed, I never got this one working!

Now if that's not your case. Did you create the Trakt app? And also, if you have upgraded to new Plex Movie Agent you need to switch back.

CoffeeKnyte commented 4 years ago

Yes, that makes sense! I also have plex-auto-collection installed and running. Their requirements must conflict somehow. I'll try uninstalling those requirements and testing again.

Thank you for pointing me in the right direction.

morganzero commented 4 years ago

That's also my theory. In the best of worlds we'd figure out what and also how to make them work properly together. I think it's possible to have them contained in Docker. That way they wouldn't conflict with one another. But I don't have alot of Docker skills to make that happen.

Let me know if you run into any issues with Plex-Library and I'll try to help you out.

CoffeeKnyte commented 3 years ago

I managed to get it working after removing plex-auto-collections (PAC) requirements and re-installing python-plexlibrary (PPL) requirements.

  1. In the PAC folder I did sudo -H pip3 uninstall -r requirements.txt and sudo -H pip uninstall -r requirements.txt to uninstall both the python2 and python3 requirements.
  2. In the PPL folder I did the same steps to uninstall both the python2 and python3 requirements.
  3. In the PPL folder I ran pip3 install -r requirements.txt
  4. Errors still occurred, pointing to plexapi module
  5. I force installed plexapi with pip3 install plexapi==4.2.0
  6. New errors occurred pointing to the trakt module
  7. I force installed trakt with pip3 install trakt==2.14.0
  8. Errors with the trakt module still occurred
  9. I force installed an older version of trakt with pip3 install trakt==2.13.0
  10. This fixed it
morganzero commented 3 years ago

Did you by any chance get PAC to function on the same machine as PPL?

I'm thinking about making dockerized versions of both.

g0d-m0nky commented 3 years ago

Having the same issue here even after removing PAC. Coffee, in your instructions you haveplexapi with pip3 install plexapi==4.2.0

That is giving me the following error

Could not find a version that satisfies the requirement plexapi==4.2.0 (from versions: 0.2, 0.2.1, 0.2.2, 0.2.3, 0.9.0, 0.9.1, 0.9.2, 0.9.3, 0.9.4, 0.9.6, 1.0.0, 1.0.1, 1.0.2, 1.1.0, 2.0.1, 2.0.2, 3.0.0, 3.0.1, 3.0.2, 3.0.3, 3.0.4, 3.0.5, 3.0.6, 3.1.0, 3.2.0, 3.3.0, 3.4.0, 3.5.0, 3.6.0, 4.0.0, 4.1.0, 4.1.1, 4.1.2) No matching distribution found for plexapi==4.2.0

Does it need to be 4.2.0?

timmehtimtims commented 3 years ago

@morganzero I don't suppose you got anywhere with the dockerized version for PPL? I'm having this same issue.

morganzero commented 3 years ago

I'm afraid I didn't. I was having issues and realized that development here was paused so I switched to a completely different tool for collections instead. It's currently rocking some smart collections on my server and working brill. Pm me if you want a link.

Best, Morgan On 29 Jul 2021, 23:19 +0200, timmehtimtims @.***>, wrote:

@morganzero I don't suppose you got anywhere with the dockerized version for PPL? I'm having this same issue. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

timmehtimtims commented 3 years ago

@morganzero Yeah I did the same thing a few months back and it's working great. The only draw back from not having this working is that I'd quite like to use this to create a trakt based kids library so it's kept separate from adult movies, but I suppose you can't have everything! If there was a way to have the two play nicely with each other then that would be amazing...

morganzero commented 3 years ago

I know exactly what you mean. What I ended up doing was to completely separate kids movies from the regular movies in my *arr different root path. And also change root path in the trakt import lists.

Best, Morgan On 31 Jul 2021, 09:43 +0200, timmehtimtims @.***>, wrote:

@morganzero Yeah I did the same thing a few months back and it's working great. The only draw back from not having this working is that I'd quite like to use this to create a trakt based kids library so it's kept separate from adult movies, but I suppose you can't have everything! If there was a way to have the two play nicely with each other then that would be amazing... — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

timmehtimtims commented 3 years ago

sigh - I thought you may suggest that.... did this manually in sonarr as it was a far less daunting task and didn't take long... but it would take along time to separate my established radarr library as there is no way (that I'm aware of) to retrospectively add tags from trakt lists to existing films in radarr: https://github.com/Radarr/Radarr/pull/5411

danqbudz commented 3 years ago

https://hub.docker.com/r/danqbudz/python-plexlibrary