-
-
Notifications
You must be signed in to change notification settings - Fork 11.4k
How can i install PyQt with Phonon included? #21847
Comments
We don't explicitly disable it. I have that module but when trying to import I get an error:
|
I am not sure if this an upstream or homebrew issue... |
Homebrew doesn't have a phonon formula (it's one of the orphaned kde formulae), so presumably phonon.so does nothing if it doesn't have a real phonon library to link against. |
@mistydemeo but there is |
There's two versions of Phonon; the one included in Qt and the one included with KDE (which is newer). Sometimes stuff looks for the latter and when it fails to find it complains it can't find anything. That'll be what's happening here. |
But |
Perhaps not, they might want a newer version. |
For reference, I've been hitting this same issue with PySide. brew install pyside gives me a working pyside installation, except the phonon module error. I'm not sure what the best way to debug the error further is. I was able to make "import PySide.phonon" work on my mac by installing pyside and qt binaries from http://qt-project.org/wiki/PySide_Binaries_MacOSX but this is obviously not ideal (old versions, not managed by homebrew, etc). |
Anyone good at Qt/phonon/pyside/pyqt knowing what to do here? |
I'm good at Qt/Phonon and the problem is either looking in the wrong place or having too old a version of Phonon for it to be handled properly. Can someone try and reproduce this building from source themselves? I suspect this is an upstream issue. |
Did you mean that grabbing the latest version of Phonon source code from KDE then build/compile it on OS X manually? |
If you want to go this route, it looks like kde-phonon is available by tapping tomahawk-player. see the instructions at http://wiki.tomahawk-player.org/index.php/Building_OS_X_Application_Bundle |
I followed the wiki page of Tomahawk, still no luck :(
|
From the past experience of using Macports. So, is there any workaround for this phonon thing on top of homebrew? |
I can very distantly remember that I once ran a sample python code that was using phonon to play some sound. And I did it with the brewed version. So perhaps some recent Qt/PyQt issue? |
@handsomegui @peterbrook That means taking the Qt tarball Homebrew uses and building and installing it into the same location with the same options as Homebrew and seeing if the bug is still there. If so: upstream issue. |
Any progress here? I'm seeing the exact same missing symbol. Who rebuilds the package that brew uses so that we get the right "stuff" |
@grosch as said, we didn't change anything or disable it, therefore Qt seems to have disabled or removed phonon. I think nobody had the time to do the "manual" build Mike was suggesting. |
I have a bit of time, so I'm going to try to investigate this. First off I just verified that "brew install python pyside" followed by python -c "from PySide import phonon" generates the above error on a brand new OSX install running in virtualbox. Next I'll do the manual qt install and see if the error's there, and if so I'll try to figure out how the working pyside binaries that are available for download were created. |
👍 for doing this @peterbrook. Let us know if you can find a satisfying solution. |
When trying to import PyQt4.phonon I get a slightly different error: ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/PyQt4/phonon.so, 2): no suitable image found. Did find: Can I just remove this version and try to install phonon with either Any comments? TIA |
MacPorts has a patch related to this. I don't know if it is relevant here. |
I don't want to shut down the conversation here, but is there any chance of this turning into a pull request soon? |
I've had a look into it a couple of times since, but I haven't found a solution yet. I will probably have another good look at it this July in my uni holidays. In short, it may yet turn into a pull request, but probably not soon. |
I have been using phonon with Qt 4.8.5 and PyQt4 just fine since last summer until a few days ago when I attempted the upgrade to 4.8.6. Now I get the same error @samueljohn is getting, i.e.:
If that helps, I managed to get a working setup of Qt 4.8.6, PyQt 4.10.4 and Phonon using MacPorts. |
That is very interesting. I've had a quick look at the MacPorts PyQt port file. They have kde-phonon as a dependency. e.g. They don't use the phonon included with Qt. (unlike Homebrew) |
My current feeling is that we would need to do the following to get this to work:
I'm currently testing this theory, but compiling takes a long time... |
|
Maybe, yeh. Would be better to keep it |
Thanks. I'm having a look at the diff now. If it works, it will give us something to go on. |
I've reinstalled qt 4-8.5, built from source, sip and pyqt 4.10.3 using the new formulae. And I get exactly the same error:
I don't understand why this is happening. It was working before. The difference is that I used new versions of the formulae (changing the download link) and probably I'm using a newer Xcode (5.1.1). I can't remember what version of XCode I was using last summer when I originally built pyqt, probably 4.x? |
Can you check, from |
Both .so and frameworks are linked against What specific files should I check? |
How about |
Yes. I checked phonon.so and the other pyqt so files. Same stdlib as the Qt frameworks.
|
I'm afraid I'm going to have to leave this unsolved for now, as I have uni exams and assignments to do. I'll have another go at it in the holidays. Anyone else is welcome to try, however. For future reference, here is what I am currently stuck on: The facts:
What I've tried:
What I haven't tried:
|
Is it ok that phonon.so is linked against
It might not be an issue, since it's the same for QtCore:
and |
I was just wondering that, but creating a symlink didn't change anything. |
On my MacPorts install, phonon.so is linked to a real libphonon.dylib:
|
Here's an interesting piece of trivia: The missing symbol is It can also be found in |
Interesting, on MacPorts If I change the simlink to
|
That is very odd. But, I wonder if we can perform that process in reverse. |
If I replace |
That's exactly what I wanted to know. That is very interesting. |
Can you help me use Here's what I have now:
|
The basic syntax is
It doesn't always work, however. (e.g. if the new link path is longer than the old link path, it can't change it.) |
I replaced the dynamic links to QtCore and QtGui, so now:
I can't replace the DBus link because my homebrew qt is not built with DBus and the macport version is by default. So I can successfully run:
but I have a dependency on the macports install. I will try rebuilding |
So, this is the MacPorts Phonon, with some of the links replaced by Homebrew links? Now we just have to find out how MacPorts builds phonon, and build it ourselves. I have tried building with KDE Phonon using Homebrew, and it didn't work, so they must be doing something more than just building KDE Phonon. Here is the MacPorts port file. Looking at it, they do a bunch of things and I'm not sure why they do them. However, it would be interesting to try to replicate them. |
Yes what's working for me right now is building Qt and PyQt with Homebrew then overwriting the Qt phonon framework with the MacPorts phonon libs after replacing the links with Homebrew links. I still can't understand though why I am not able to make it work with Qt 4.8.5 and PyQt 4.10.3 as before. The only difference is that I'm using the new formulae to build Qt, Sip and PyQt. So could the cause be a change in the way we build them? |
I have no idea. I wonder if we could replicate the issue by building it outside of Homebrew. |
Closing as stale, but discussion can continue here even though the issue is closed. If there is progress made, we can reopen. |
I've been working on this this last weekend and I think I have a theory. My team had run into a weird issue where functions that were supposed to be inlined in code, were actually left the symbol table of the resulting library. This looks to be a bug in clang. The problem we're running into here manifests itself in a very similar way, so I think either it's the same bug, or one closely related. If you look at the symbol in question in the Homebrew Qt install, you can see it's a weak symbol in the library:
Notice the lower-case 't' in front of the symbol. These are weak symbols, and I believe the clang bug is leaving them visible outside the library when they shouldn't be. In versions of Qt built with an earlier g++ compiler, these would have an upper-case "T" and be strong symbols that can be seen (and used) outside the library. This symbol is not the only one that needs to be visible, BTW. In order to get this working with the new clang, I patched the code to set the visibility of these symbols to "default" like the older Qt builds:
(It might also be that the PHONON_TEMPLATE_CLASS_MEMBER_EXPORT macro is supposed to do this, and is somehow broken, but it just seems to be resolving to Q_DECL_EXPORT or Q_DECL_IMPORT under the covers, so I'm not sure why that wouldn't work.) By re-building Qt with this patch, and then re-building pyqt from source against it, I'm now able to get phonon to import with only Homebrew components. For those interested in the clang bug, the discussion is here: |
Just realized that I didn't have to rebuild PyQt after all, only Qt. |
This is very interesting, but very much above my knowledge / skill level. |
After i installed PyQt4 by:
brew update
brew install pyqt
Homebrew installed me a PyQt at version 4.10.2, but with no
Phonon
module compiled.When i run some app that required
Phonon
, it reports:"Your Qt installation does not have Phonon support."
I have tried:
brew search phonon
with no results.How can i fix this by homebrew?
My installation is on Mac OS X 10.8.4 with brew-installed Python 2.7.5.
The text was updated successfully, but these errors were encountered: