[mythtv-users] find_orphans.py error
Raymond Wagner
raymond at wagnerrp.com
Mon Jan 16 22:44:54 UTC 2012
On 1/16/2012 17:27, Jeff Siddall wrote:
> On 01/16/2012 04:50 PM, Raymond Wagner wrote:
>> On 1/16/2012 16:46, Jeff Siddall wrote:
>>> /usr/local/bin/find_orphans.py
>>> File "/usr/local/bin/find_orphans.py", line 57
>>> with DB as c:
>>> ^
>>> SyntaxError: invalid syntax
>>>
>>>
>>> This is a CentOS 5.2 system. Any ideas?
>> Your system is too old to run that script. The 'with' construct was in
>> staging in Python 2.5, requiring a special future import to make it
>> work, and was not proper syntax until Python 2.6. CentOS 5 uses Python 2.4.
> Thanks for the quick reply. I do have python2.6 installed. When I run
> it with that I now get:
>
> python2.6 ./find_orphans.py
> Traceback (most recent call last):
> File "./find_orphans.py", line 3, in<module>
> from MythTV import MythDB, MythBE, Recorded, MythError
> ImportError: No module named MythTV
>
> Hmmm...
>
> rpm -ql python-MythTV shows myth python stuff is installed in
> /usr/lib/python2.4/site-packages/MythTV
If your Python bindings exist here, they are broken. The version of the
bindings that ships with 0.24 requires Python 2.5 at minimum. The
version of bindings that ships with 0.25 requires Python 2.6 at
minimum. That script does not work with the bindings that ship with
0.23 or previous.
> Is that what is missing? If so is there some easy way I can tell
> python2.6 to look there?
When compiling MythTV, the configure script must be told where to find
the proper python executable. It defaults to 'python', and if instead
that maps to Python 2.4, it will refuse to install them. The installer
will automatically install to where ever that executable wants the files
to go, unless manually specified otherwise.
If you are using an executable other than 'python', you will need to
update the 'bang' line at the top of the script to point to a different
interpreter.
More information about the mythtv-users
mailing list