[MacPorts] #36783: mythtv-core.25 00.25.2-Fixes-20120918 Python paths wrong for site-packages/MythTV
#36783: mythtv-core.25 00.25.2-Fixes-20120918 Python paths wrong for site- packages/MythTV ---------------------------+-------------------------------- Reporter: ted.rippert@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Keywords: | Port: ---------------------------+-------------------------------- The python modules stored in the tree beginning at /opt/local/lib/python2.6/site-packages/MythTV cannot be loaded by the macports python2.6 installation since it utilizes /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6 /site-packages for third party modules. This results, for example, in the metadata grabbers not working. Work around: cd /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6 /site-packages sudo ln -s /opt/local/lib/python2.6/site-packages/MythTV MythTV -- Ticket URL: <https://trac.macports.org/ticket/36783> MacPorts <http://www.macports.org/> Ports system for Mac OS
#36783: mythtv-core.25 00.25.2-Fixes-20120918 Python paths wrong for site- packages/MythTV ----------------------------+-------------------------------- Reporter: ted.rippert@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: | Keywords: Port: | ----------------------------+-------------------------------- Comment (by ted.rippert@…): Replying to [comment:1 pixilla@…]:
Cc Me!
I forgot to fill in the port field in the original ticket. I can't seem to change it now. The port is mythtv-core.25 00.25.2-Fixes-20120918. -- Ticket URL: <https://trac.macports.org/ticket/36783#comment:2> MacPorts <http://www.macports.org/> Ports system for Mac OS
#36783: mythtv-core.25 00.25.2-Fixes-20120918 Python paths wrong for site- packages/MythTV -----------------------------+-------------------------------- Reporter: ted.rippert@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: | Keywords: Port: mythtv-core.25 | -----------------------------+-------------------------------- Changes (by macsforever2000@…): * port: => mythtv-core.25 Old description:
The python modules stored in the tree beginning at /opt/local/lib/python2.6/site-packages/MythTV cannot be loaded by the macports python2.6 installation since it utilizes /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6 /site-packages for third party modules. This results, for example, in the metadata grabbers not working.
Work around:
cd /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6 /site-packages
sudo ln -s /opt/local/lib/python2.6/site-packages/MythTV MythTV
New description: The python modules stored in the tree beginning at /opt/local/lib/python2.6/site-packages/MythTV cannot be loaded by the macports python2.6 installation since it utilizes /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6 /site-packages for third party modules. This results, for example, in the metadata grabbers not working. Work around: {{{ cd /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6 /site-packages }}} {{{ sudo ln -s /opt/local/lib/python2.6/site-packages/MythTV MythTV }}} -- Comment: The port is actually called "mythtv-core.25". The rest is the version number. Also, please use WikiFormatting in the future. -- Ticket URL: <https://trac.macports.org/ticket/36783#comment:3> MacPorts <http://www.macports.org/> Ports system for Mac OS
#36783: mythtv-core.25 00.25.2-Fixes-20120918 Python paths wrong for site- packages/MythTV -----------------------------+-------------------------------- Reporter: ted.rippert@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: | Keywords: Port: mythtv-core.25 | -----------------------------+-------------------------------- Comment (by ted.rippert@…): Sorry about all that. I'm new to writing tickets here. You might want to add ctreleaven@cogeco.ca as a CC since he's the maintainer for the port. Thanks. -- Ticket URL: <https://trac.macports.org/ticket/36783#comment:4> MacPorts <http://www.macports.org/> Ports system for Mac OS
#36783: mythtv-core.25 00.25.2-Fixes-20120918 Python paths wrong for site- packages/MythTV -----------------------------+-------------------------- Reporter: ted.rippert@… | Owner: ctreleaven@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: | Keywords: Port: mythtv-core.25 | -----------------------------+-------------------------- Changes (by macsforever2000@…): * owner: macports-tickets@… => ctreleaven@… -- Ticket URL: <https://trac.macports.org/ticket/36783#comment:5> MacPorts <http://www.macports.org/> Ports system for Mac OS
#36783: mythtv-core.25 00.25.2-Fixes-20120918 Python paths wrong for site- packages/MythTV -----------------------------+-------------------------- Reporter: ted.rippert@… | Owner: ctreleaven@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: | Keywords: Port: mythtv-core.25 | -----------------------------+-------------------------- Comment (by ctreleaven@…): Being no expert in Python, I was advised to add the following to my /users/<username>/.profile : export PYTHONPATH=/opt/local/lib/python2.6/site-packages:$PYTHONPATH Works for me! -- Ticket URL: <https://trac.macports.org/ticket/36783#comment:6> MacPorts <http://www.macports.org/> Ports system for Mac OS
#36783: mythtv-core.25 00.25.2-Fixes-20120918 Python paths wrong for site- packages/MythTV -----------------------------+-------------------------- Reporter: ted.rippert@… | Owner: ctreleaven@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: | Keywords: Port: mythtv-core.25 | -----------------------------+-------------------------- Comment (by ted.rippert@…): The PYTHONPATH variable in .profile would work for an individual user when they start the backend from the command line, but not generally. Since the backend is started by a plist in /Library/LaunchDeamons you would need to insert an environment variable statement into the plist to set it up for the automated backend launcher. Since the mythbackend plist is created by the macports installation, that may be a file you could modify in the port to get this working out of the box for a new installation. -- Ticket URL: <https://trac.macports.org/ticket/36783#comment:7> MacPorts <http://www.macports.org/> Ports system for Mac OS
#36783: mythtv-core.25 00.25.2-Fixes-20120918 Python paths wrong for site- packages/MythTV -----------------------------+-------------------------- Reporter: ted.rippert@… | Owner: ctreleaven@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: | Keywords: Port: mythtv-core.25 | -----------------------------+-------------------------- Comment (by ctreleaven@…): The backend plist does set PYTHONPATH (as well as HOME) for the backend, see: https://trac.macports.org/browser/trunk/dports/multimedia/mythtv- core.25/files/org.mythtv.mythbackend.plist If you enable the automatic metadata update, it should inherit that environment when it runs. Log output from those runs should be in /opt/local/var/log/mythttv.25/ . The frontend user still needs PYTHONPATH to do metadatalookups while creating a new recording rule, etc. -- Ticket URL: <https://trac.macports.org/ticket/36783#comment:8> MacPorts <http://www.macports.org/> Ports system for Mac OS
#36783: mythtv-core.25 00.25.2-Fixes-20120918 Python paths wrong for site- packages/MythTV -----------------------------+-------------------------- Reporter: ted.rippert@… | Owner: ctreleaven@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: | Keywords: Port: mythtv-core.25 | -----------------------------+-------------------------- Comment (by ted.rippert@…): You're right, of course. I actually modified the EnvironmentVariables key without noticing the PYTHONPATH key in it. The automated backend metadata updates seemed very flaky (only worked once for some reason), and all the frontend and mythweb rescans didn't work at all until I added the symbolic link noted in the original ticket. Given that, I would recommend that the port should create the symbolic link noted in the workaround as a fix. The PYTHONPATH definition would then be redundant, and there might be a better way from the python point of view. I'm no expert in python either. By the way, the other keys I added to the EnvironmentVariables group are: {{{ <key>LC_CTYPE</key> <string>en_US.UTF-8</string> <key>LANG</key> <string>en_US.UTF-8</string> }}} This was to get rid of a warning about the language definition that kept popping up in the backend logs. I didn't notice any real problems with the port operation due to this warning, so I didn't think it rated a ticket. -- Ticket URL: <https://trac.macports.org/ticket/36783#comment:9> MacPorts <http://www.macports.org/> Ports system for Mac OS
#36783: mythtv-core.25 00.25.2-Fixes-20120918 Python paths wrong for site- packages/MythTV -----------------------------+-------------------------- Reporter: ted.rippert@… | Owner: ctreleaven@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: | Keywords: Port: mythtv-core.25 | -----------------------------+-------------------------- Comment (by nad@…): If the mythtv port is installing into /opt/local/lib/python2.x/site- packages, the port is behaving incorrectly for MacPorts Pythons. It should be installing into the standard framework location `/opt/local/Library/Frameworks/Python.framework/Versions/2.x/lib/python2.x /site-packages`. Setting `PYTHONPATH` or the suggested symlinks are fragile bandaids. If the port is using standard Python installation components, like Distutils, things should be automatically installed in the right place. -- Ticket URL: <https://trac.macports.org/ticket/36783#comment:10> MacPorts <http://www.macports.org/> Ports system for Mac OS
#36783: mythtv-core.25 00.25.2-Fixes-20120918 Python paths wrong for site- packages/MythTV -----------------------------+-------------------------- Reporter: ted.rippert@… | Owner: ctreleaven@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: | Keywords: Port: mythtv-core.25 | -----------------------------+-------------------------- Comment (by ctreleaven@…): Replying to [comment:10 nad@…]:
... standard Python installation components, like Distutils, things should be automatically installed in the right place.
Perhaps you can assist. AFAICT, Myth is using disutils (see https://github.com/MythTV/mythtv/blob/fixes/0.25/mythtv/bindings/python/setu... ). If the port is failing to set up something, I'd be glad to know it. As I said, I don't know Python. In fact, Myth's Python bindings are heavily used by certain Myth plugins and I have not been able to make those plugins work satisfactorily. (And thus the port hasn't been submitted to MacPorts.) Perhaps an improper installation of the bindings is at fault? -- Ticket URL: <https://trac.macports.org/ticket/36783#comment:11> MacPorts <http://www.macports.org/> Ports system for Mac OS
#36783: mythtv-core.25 00.25.2-Fixes-20120918 Python paths wrong for site- packages/MythTV -----------------------------+-------------------------- Reporter: ted.rippert@… | Owner: ctreleaven@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: | Keywords: Port: mythtv-core.25 | -----------------------------+-------------------------- Comment (by ted.rippert@…): Replying to [comment:11 ctreleaven@…]:
Replying to [comment:10 nad@…]:
... standard Python installation components, like Distutils, things should be automatically installed in the right place.
Perhaps you can assist. AFAICT, Myth is using disutils (see https://github.com/MythTV/mythtv/blob/fixes/0.25/mythtv/bindings/python/setu... ).
Looking at the file you reference, the first line is: {{{ #!/usr/bin/env python }}} When I invoke it this way in a terminal window, I get the Apple installed python from /usr/bin/ Actually I have separate python installs for 2.5, 2.6 and 2.7 in /usr/bin, /opt/local/bin and /sw/bin. Perhaps the interpreter for the script should be: {{{ #!/opt/local/bin/python2.x }}} where I assume you would use x=6, since all the MythTV scripts I found were under 2.6 rather than 2.7. -- Ticket URL: <https://trac.macports.org/ticket/36783#comment:12> MacPorts <http://www.macports.org/> Ports system for Mac OS
#36783: mythtv-core.25 00.25.2-Fixes-20120918 Python paths wrong for site- packages/MythTV -----------------------------+-------------------------- Reporter: ted.rippert@… | Owner: ctreleaven@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: | Keywords: Port: mythtv-core.25 | -----------------------------+-------------------------- Comment (by ted.rippert@…): OK. I've played around with it, and I think I see what is going on. Here's what gives the correct install path: {{{ $ /opt/local/bin/python2.6 -c "from distutils.sysconfig import get_python_lib; print get_python_lib()" /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6 /site-packages }}} Here's what I get using the syntax from the MythTV setup.py in my normal shell: {{{ $ /usr/bin/env python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()" /Library/Python/2.5/site-packages }}} which doesn't seem to give anything like the path that the MythTV port ended up using. However, assuming that "python" in the port set-up had been aliased to python2.6: {{{ $ /usr/bin/env python2.6 -c "from distutils.sysconfig import get_python_lib; print get_python_lib()" /sw/lib/python2.6/site-packages }}} which is in my Fink installation. Assuming that your port is set to replace install directory prefixes with /opt/local, you end up with the /opt/local/lib/python2.6/site-packages that the MythTV directory ended up in for me. It seems like the script would work as is if the macports tree was before the Fink tree in my path, but that seems like something prone to breakage for a lot of people. I don't know if all your bindings problems are caused by this, but you might try using the explicit path to the macports python2.6 in your setup scripts if that is an acceptable practice. -- Ticket URL: <https://trac.macports.org/ticket/36783#comment:13> MacPorts <http://www.macports.org/> Ports system for Mac OS
#36783: mythtv-core.25 00.25.2-Fixes-20120918 Python paths wrong for site- packages/MythTV -----------------------------+-------------------------- Reporter: ted.rippert@… | Owner: ctreleaven@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: | Keywords: Port: mythtv-core.25 | -----------------------------+-------------------------- Comment (by pixilla@…): It would be better for the Portfile to replace "/usr/bin/env python" with "/opt/local/bin/python2.6". -- Ticket URL: <https://trac.macports.org/ticket/36783#comment:14> MacPorts <http://www.macports.org/> Ports system for Mac OS
#36783: mythtv-core.25 00.25.2-Fixes-20120918 Python paths wrong for site- packages/MythTV -----------------------------+-------------------------- Reporter: ted.rippert@… | Owner: ctreleaven@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: | Keywords: Port: mythtv-core.25 | -----------------------------+-------------------------- Comment (by ctreleaven@…): Working on it now... -- Ticket URL: <https://trac.macports.org/ticket/36783#comment:15> MacPorts <http://www.macports.org/> Ports system for Mac OS
#36783: mythtv-core.25 00.25.2-Fixes-20120918 Python paths wrong for site- packages/MythTV -----------------------------+-------------------------- Reporter: ted.rippert@… | Owner: ctreleaven@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: | Keywords: Port: mythtv-core.25 | -----------------------------+-------------------------- Comment (by ctreleaven@…): Modifying the shebang lines* did _not_ cause Myth's python modules to be installed under /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6 /site-packages The log verifies that mythtv/bindings/python/setup.py was executed with /opt/local/bin/python2.6, as expected. Going to ask for assistance on the macports-dev list. *There are close to 100 python scripts in the MythTV source! -- Ticket URL: <https://trac.macports.org/ticket/36783#comment:16> MacPorts <http://www.macports.org/> Ports system for Mac OS
#36783: mythtv-core.25 00.25.2-Fixes-20120918 Python paths wrong for site- packages/MythTV -----------------------------+-------------------------- Reporter: ted.rippert@… | Owner: ctreleaven@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: fixed | Keywords: Port: mythtv-core.25 | -----------------------------+-------------------------- Changes (by pixilla@…): * status: new => closed * resolution: => fixed Comment: See r99758 -- Ticket URL: <https://trac.macports.org/ticket/36783#comment:17> MacPorts <http://www.macports.org/> Ports system for Mac OS
participants (1)
-
MacPorts