adamgot / python-plexlibrary

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

Difficulties installing from pip #97

Closed timmehtimtims closed 3 years ago

timmehtimtims commented 4 years ago

Initially, the pip install failed: /opt/appdata/python-plexlibrary$ pip install -r requirements.txt /usr/lib/python2.7/dist-packages/secretstorage/dhcrypto.py:15: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in a future release. from cryptography.utils import int_from_bytes DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality. WARNING: The directory '/home/timmeh/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. Defaulting to user installation because normal site-packages is not writeable Collecting plexapi Downloading PlexAPI-4.1.0.tar.gz (89 kB) |████████████████████████████████| 89 kB 1.5 MB/s ERROR: Package 'PlexAPI' requires a different Python: 2.7.17 not in '>=3.5' WARNING: You are using pip version 20.2.3; however, version 20.2.4 is available. You should consider upgrading via the '/usr/bin/python -m pip install --upgrade pip' command.

I got around this by using pip3 install -r requirements.txt WARNING: The directory '/home/timmeh/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. Defaulting to user installation because normal site-packages is not writeable Collecting plexapi Downloading PlexAPI-4.1.2.tar.gz (91 kB) |████████████████████████████████| 91 kB 5.5 MB/s Requirement already satisfied: requests in /usr/local/lib/python3.6/dist-packages (from -r requirements.txt (line 3)) (2.18.4) Collecting trakt Downloading trakt-2.14.1.tar.gz (35 kB) Collecting ruamel.yaml Downloading ruamel.yaml-0.16.12-py2.py3-none-any.whl (111 kB) |████████████████████████████████| 111 kB 9.8 MB/s Requirement already satisfied: lxml in /usr/local/lib/python3.6/dist-packages (from -r requirements.txt (line 6)) (4.5.2) Requirement already satisfied: idna<2.7,>=2.5 in /usr/local/lib/python3.6/dist-packages (from requests->-r requirements.txt (line 3)) (2.6) Requirement already satisfied: urllib3<1.23,>=1.21.1 in /usr/local/lib/python3.6/dist-packages (from requests->-r requirements.txt (line 3)) (1.22) Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /usr/local/lib/python3.6/dist-packages (from requests->-r requirements.txt (line 3)) (3.0.4) Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.6/dist-packages (from requests->-r requirements.txt (line 3)) (2020.6.20) Collecting requests-oauthlib>=0.6 Downloading requests_oauthlib-1.3.0-py2.py3-none-any.whl (23 kB) Requirement already satisfied: six>=1.10 in /usr/local/lib/python3.6/dist-packages (from trakt->-r requirements.txt (line 4)) (1.15.0) Collecting ruamel.yaml.clib>=0.1.2; platform_python_implementation == "CPython" and python_version < "3.9" Downloading ruamel.yaml.clib-0.2.2-cp36-cp36m-manylinux1_x86_64.whl (549 kB) |████████████████████████████████| 549 kB 9.4 MB/s Collecting oauthlib>=3.0.0 Downloading oauthlib-3.1.0-py2.py3-none-any.whl (147 kB) |████████████████████████████████| 147 kB 15.2 MB/s Building wheels for collected packages: plexapi, trakt Building wheel for plexapi (setup.py) ... done Created wheel for plexapi: filename=PlexAPI-4.1.2-py3-none-any.whl size=104596 sha256=c0e8b63d0626649280776815eaf7285c605fd81c236261982a5cb59bc0b29b6e Stored in directory: /tmp/pip-ephem-wheel-cache-7hrpcr7w/wheels/45/73/91/2860d7e2200f1b4739cf7a1b38cf12b8bedab90721721e6135 Building wheel for trakt (setup.py) ... done Created wheel for trakt: filename=trakt-2.14.1-py3-none-any.whl size=39662 sha256=016ff83afececd4c8695878d51d6c574848e66897b03baa0d1fe80aae1547b5a Stored in directory: /tmp/pip-ephem-wheel-cache-7hrpcr7w/wheels/6e/1a/68/d76c7ea3cc2ff02b54ddf8bedf04536162955c02eb141d4c03 Successfully built plexapi trakt Installing collected packages: plexapi, oauthlib, requests-oauthlib, trakt, ruamel.yaml.clib, ruamel.yaml Successfully installed oauthlib-3.1.0 plexapi-4.1.2 requests-oauthlib-1.3.0 ruamel.yaml-0.16.12 ruamel.yaml.clib-0.2.2 trakt-2.14.1 WARNING: You are using pip version 20.2.3; however, version 20.2.4 is available. You should consider upgrading via the '/usr/bin/python3 -m pip install --upgrade pip' command.

I believe that this is the cause of issue #93

What is the best way to go back and delete the setup files and set this up properly using pip, but installing using python3 (python 2.7 is needed as the default for the time being)?

timmehtimtims commented 4 years ago

I changed to python 3.6 for install purposes. I then reverted back to 2.7.17 (as this is still needed as the default alias) When I run python3 plexlibrary 'recipe' I get this:

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 67, in main
    r.run(sort_only=args.sort_only, share_playlist_to_all=args.everyone)
  File "plexlibrary/recipe.py", line 654, in run
    missing_items, list_count = self._run(share_playlist_to_all=share_playlist_to_all)
  File "plexlibrary/recipe.py", line 592, in _run
    source_libraries = self._get_plex_libraries()
  File "plexlibrary/recipe.py", line 122, in _get_plex_libraries
    if 'guid' not in source_library.ALLOWED_FILTERS:
AttributeError: 'ShowSection' object has no attribute 'ALLOWED_FILTERS'
timmehtimtims commented 4 years ago

I have looked at my dependancies and all appear correct and up to date:

Requirement already satisfied: plexapi in /usr/local/lib/python3.6/dist-packages (from -r requirements.txt (line 2)) (4.2.0)
Requirement already satisfied: requests in /usr/local/lib/python3.6/dist-packages (from -r requirements.txt (line 3)) (2.24.0)
Requirement already satisfied: trakt in /usr/local/lib/python3.6/dist-packages (from -r requirements.txt (line 4)) (2.14.1)
Requirement already satisfied: ruamel.yaml in /usr/local/lib/python3.6/dist-packages (from -r requirements.txt (line 5)) (0.16.12)
Requirement already satisfied: lxml in /usr/local/lib/python3.6/dist-packages (from -r requirements.txt (line 6)) (4.6.1)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/local/lib/python3.6/dist-packages (from requests->-r requirements.txt (line 3)) (1.22)
Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.6/dist-packages (from requests->-r requirements.txt (line 3)) (2.6)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.6/dist-packages (from requests->-r requirements.txt (line 3)) (2020.6.20)
Requirement already satisfied: chardet<4,>=3.0.2 in /usr/local/lib/python3.6/dist-packages (from requests->-r requirements.txt (line 3)) (3.0.4)
Requirement already satisfied: six>=1.10 in /usr/local/lib/python3.6/dist-packages (from trakt->-r requirements.txt (line 4)) (1.15.0)
Requirement already satisfied: requests-oauthlib>=0.6 in /home/usr/.local/lib/python3.6/site-packages (from trakt->-r requirements.txt (line 4)) (1.3.0)
Requirement already satisfied: ruamel.yaml.clib>=0.1.2; platform_python_implementation == "CPython" and python_version < "3.9" in /home/usr/.local/lib/python3.6/site-packages (from ruamel.yaml->-r requirements.txt (line 5)) (0.2.2)
Requirement already satisfied: oauthlib>=3.0.0 in /home/usr/.local/lib/python3.6/site-packages (from requests-oauthlib>=0.6->trakt->-r requirements.txt (line 4)) (3.1.0)

I also have mock installed. Is there anything else that I am missing as far as dependancies go?

mza921 commented 3 years ago

This script doesn't work with plexapi 4.2.0. You'll probably have to downgrade to 4.1.2.

timmehtimtims commented 3 years ago

Legend. All working again. :)

chiggerz commented 3 years ago

im still getting my head round all this, but how do you downgrade? I am also getting this error and have plexapi 4.2.0, but have no idea how to go back to 4.1.2. Any help please?

timmehtimtims commented 3 years ago

Do: pip uninstall PlexAPI

Then: pip install PlexAPI==4.1.2

chiggerz commented 3 years ago
Screenshot 2020-11-20 at 09 53 35

wow thanks! I assume I can do 4.1.0 instead?

chiggerz commented 3 years ago

Collecting PlexAPI==4.1.0 Using cached PlexAPI-4.1.0.tar.gz (89 kB) ERROR: Package 'PlexAPI' requires a different Python: 2.7.17 not in '>=3.5'

chiggerz commented 3 years ago

got it.... done pip3 install PlexAPI==4.1.2