MythTV ver 31/fixes upgrade to python 3.10.0

Have a MythTV related problem? Ask for help from other MythTV users here.

Moderator: Forum Moderators

Post Reply
rocknrobin72
Junior
Posts: 65
Joined: Thu Mar 26, 2020 8:07 pm
United States of America

MythTV ver 31/fixes upgrade to python 3.10.0

Post by rocknrobin72 »

Hi All. I have been using mythTV for almost two years and it works great for me. I am running version 31/fixes on a Slackware 14.2 distribution. Recently the Slackpkg updates had an update from python 3.9.7 to 3.10.0. After the upgrade for python I noticed that the backend still starts okay, but when I ran the tests for metadata I got this message back

The modules tvdb_api.py (v2.0 or greater).
They should have been installed along with the MythTV python bindings.
instead of the "everything appears to be in order" that I normally get. I then got a fresh pull for 31/fixes from github and went through the compiling from source process. The first time I ran configure I get the message that that the python bindings failed because of needing to install mysqldb, lxml, and simplejson. I installed those again via pip and when I ran configure again the python bindings were successful. I then completed the compile process with these commands as had been recommended to me in the past from this forum.

./configure
make PREFIX=/usr/local PYTHON=python3
sudo make install PREFIX=/usr/local PYTHON=python3

Everything compiled fine, and as I mentioned I had all the required bindings. I was then able to start the backend successfully, but when I ran the tests to check the metadata aps these were the results:

$ /usr/local/share/mythtv/metadata/Television/ttvdb.py -t

The modules tvdb_api.py (v2.0 or greater).
They should have been installed along with the MythTV python bindings.
Error:(module 'requests_cache' has no attribute 'core')

$ /usr/local/share/mythtv/metadata/Movie/tmdb3.py --test

Traceback (most recent call last):
File "/usr/local/share/mythtv/metadata/Movie/tmdb3.py", line 150, in <module>
sys.exit(main("movie",'tmdb3.py'))
File "/usr/local/share/mythtv/metadata/Movie/tmdb3.py", line 77, in main
from MythTV.tmdb3.lookup import timeouthandler
File "/usr/lib64/python3.10/site-packages/MythTV/tmdb3/__init__.py", line 5, in <module>
from .tmdb_api import Configuration, searchMovie, searchMovieWithYear, \
File "/usr/lib64/python3.10/site-packages/MythTV/tmdb3/tmdb_api.py", line 71, in <module>
from .pager import PagedRequest
File "/usr/lib64/python3.10/site-packages/MythTV/tmdb3/pager.py", line 8, in <module>
from collections import Sequence, Iterator
ImportError: cannot import name 'Sequence' from 'collections' (/usr/lib64/python3.10/collections/__init__.py)
I am not sure what direction to go from here. The frontend can connect to the backend, I see my recorded shows and can watch live TV, but
I am concerned that the python scrips are not working to collect the metadata on shows that I record.

Does anyone have any idea what may have happened. Thanks in advance.
User avatar
dnalorernst
Developer
Posts: 103
Joined: Mon Feb 17, 2020 8:03 pm
Austria

Re: MythTV ver 31/fixes upgrade to python 3.10.0

Post by dnalorernst »

I just backported the changes of #374 to fixes/31, see
https://github.com/MythTV/mythtv/issues/374
The changes belong only to a view python files.
BTW, does Slackware 14.2 really defaults to python3.10?
It looks to me, that your are on the `current` tree.
rocknrobin72
Junior
Posts: 65
Joined: Thu Mar 26, 2020 8:07 pm
United States of America

Re: MythTV ver 31/fixes upgrade to python 3.10.0

Post by rocknrobin72 »

Thanks for the quick response dnalorernst. What I am gathering from your response is that I can get another pull from github, because you have made the necessary changes there, compile again and this should fix the issues with the upgrade to python 3.10.0 that I have seen here?

Oh and yes I am using the 'current' tree with the Slackpkg updates mirror. I have been doing my updates for Slackware for several years from this tree and it has bitten me a few times. The last time the update for the mariadb came out I finally had to downgrade to the previous version to fix problems generated with MythTV. My understanding is that the 'current' tree is more or less the beta platform. Is this a bad practice?
User avatar
dnalorernst
Developer
Posts: 103
Joined: Mon Feb 17, 2020 8:03 pm
Austria

Re: MythTV ver 31/fixes upgrade to python 3.10.0

Post by dnalorernst »

At least, if you are using MySQL > 8.0.0, then a 'compile again' is strongly advised, see
viewtopic.php?f=36&t=4628

Note: Just install all the latest libmyth-python dependencies from pythons 'pip' is dangerous, see
https://lists.archive.carbon60.com/mythtv/users/638109?
You need to be careful to select the right python package versions.

> My understanding is that the 'current' tree is more or less the beta platform. Is this a bad practice?
We appreciate any feedback that helps us to improve MythTV!
rocknrobin72
Junior
Posts: 65
Joined: Thu Mar 26, 2020 8:07 pm
United States of America

Re: MythTV ver 31/fixes upgrade to python 3.10.0

Post by rocknrobin72 »

Thanks again dnalorernst. Pursuant to your responses I downloaded the latest pull from Github for fixes-31. I was able to then successfully compile from source based on, I assume, changes you made pursuant to my original post on the problem with #374. I was able to launch mythbackend successfully and the first python test worked:

# /usr/local/share/mythtv/metadata/Movie/tmdb3.py --test
Everything appears in order.
This test was the one that had the issue with cannot import name 'Sequence' from 'collections'. I ran the second test and had the original issue as before:

# /usr/local/share/mythtv/metadata/Television/ttvdb.py -t

The modules tvdb_api.py (v2.0 or greater).
They should have been installed along with the MythTV python bindings.
Error:(module 'requests_cache' has no attribute 'core')
Also per your second post and the link to the 638109 issue I indeed had python package requests-cache 0.8.1. I tried installing 0.8.0 through pip with the same results. I then installed requests-cache 0.7.5 and the Television metadata test was successful.

# /usr/local/share/mythtv/metadata/Television/ttvdb.py -t
Everything appears to be in order
I was able to launch the frontend and everything looks to be working again. I viewed live tv which showed the metadata for that program and then set up a recording for later tonight which I will check later.

Is there a possibility that there will be a fix coming out so that the python api will work with requests-cache 0.8.1 or newer?
User avatar
dnalorernst
Developer
Posts: 103
Joined: Mon Feb 17, 2020 8:03 pm
Austria

Re: MythTV ver 31/fixes upgrade to python 3.10.0

Post by dnalorernst »

Is there a possibility that there will be a fix coming out so that the python api will work with requests-cache 0.8.1 or newer?
Hope springs eternal....
Issue https://github.com/MythTV/mythtv/issues/408
created, will test a patch soon.
rocknrobin72
Junior
Posts: 65
Joined: Thu Mar 26, 2020 8:07 pm
United States of America

Re: MythTV ver 31/fixes upgrade to python 3.10.0

Post by rocknrobin72 »

Thank you.
Post Reply