New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
py2app 0.64 fails to find sip from mac homebrew #35
Comments
Original comment by C.Y. Pang (Bitbucket: [Shuge Lee](https://bitbucket.org/Shuge Lee), ). https://github.com/shuge/Enjoy-Qt-Python-Binding/tree/master/package_maker |
Original comment by Anonymous. I don't know what I need to do with your URL. I don't like macports as it breaks to often. Homebrew is much easier and has better support for current OSX versions. I don't need a 32bit bin nor a PPC build; so building all the deps with homebrew is far easier to maintain and builds smaller apps for me. For your information: a while ago I tried to install python27 with QT on OSX 10.6 with macports, but it failed, I can't work with python2.5 which is used in your example. py2app 0.6.3 builds my app just fine on a mac with home brew python, qt and pyqt. |
Original comment by Anonymous. I managed to get this working with a quick and dirty link: ln -s /usr/local/lib/python /usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/2.7/share/sip -TP |
Original comment by Autobot (Bitbucket: acidjunk, GitHub: acidjunk). On my, not so clean 10.7 system I dind't have a /usr/local/lib/python: py2app worked fine after that. Still I think this is a small bug in py2app 0.6.4 because py2app 0.6.3 just works fine without the symlink. |
Original comment by Michael McCracken (Bitbucket: mikemccracken, GitHub: mikemccracken). I just ran into this too - so I poked at it a bit: NOTE: this is on 10.6.8. py2app is using sip's config variable "default_sip_dir" - which SIP's docs say is the default place for .sip specification files. We get this error because --sipdir is not being sent to SIP's configure in the homebrew recipe: The reason the symlink hack above works is that there appear to be no .sip spec files installed or used by default, so it's OK to have an empty directory - we're not missing anything. However, it doesn't look like the code is only expecting to get .sip files from that dir, it's expecting to get python packages. That doesn't give us the error anymore at build time but doesn't work at runtime. Can anyone enlighten me? I will keep working on this but I wouldn't mind some help. |
Original comment by Ronald Oussoren (Bitbucket: ronaldoussoren, GitHub: ronaldoussoren). The Qt recipe was written using notes from a py2app user that only used the Qt binary installer. I've adapted it for later editions of Qt without fully understanding how Qt and sip actually work. IIRC it assumes that the top-level files/directories it finds in the SIP repository are the names of Python packages, all of which are copied into the application bundle because it is impossible to automatically detect dependencies for modules wrapped using sip. PyQt4 is treated specially because it is a nested package, the actual SIP wrappers are in sub packages of PyQt4. To rephrase, the SIP recipe looks in the SIP repository for libraries that are wrapped using SIP and than adds those names to the list of python packages that should be excluded in the application bundle. |
Original comment by Sebastian Krysmanski (Bitbucket: skrysmanski, GitHub: skrysmanski). I guess, the solution is to check whether the sip directory actually exists. Here's the changed code (for file ##/Library/Python/2.7/site-packages/py2app/recipes/sip.py## starting in line ##47## ):
|
Original comment by Michael McCracken (Bitbucket: mikemccracken, GitHub: mikemccracken). @skrysmanski, that wasn't enough for me - just ignoring a missing default sip dir avoids the missing directory error but also won't find the PyQt modules the function is looking for. I ended up using a different PyQt config variable to find the modules that we want. I put the changes that did work for me in a fork and sent a pull request. There's one tweak - if you really need the 'uic' module and you're running python2, my solution won't work for you easily, because uic has some py3 code that uses the new metaclass= keyword syntax, which py2 won't parse. I suppose we could tell modulefinder just not to look at that part of uic. But I don't use uic so I just ignored all of it in my setup.py, and added a warning in my patch. NOTE: The patch I mentioned may not entirely work, after fixing an unrelated problem that stopped me from testing it, I find that my app is loading two versions of Qt and crashing - so I removed my pull request and will keep working on it in my private fork. |
Original comment by Michael McCracken (Bitbucket: mikemccracken, GitHub: mikemccracken). Final comment: the patch does work for me, so I re-created the pull request. The multiple Qt version problem is separate, it's about Qt plugins and can be fixed by 'touch MyApp.app/Contents/Resources/qt.conf'. |
Original comment by Frank Spano (Bitbucket: mrmuler, ). I'm having the same problem, I Installed PyQt from the PyQtX project. My application runs perfectly from the py file, but for some reason I get that sip error when I try to build my app. The reason is evident, there is no such directory, buy why??? Am I missing something?? error: /Library/Frameworks/Python.framework/Versions/2.7/share/sip: No such file or directory |
Original comment by Frank Spano (Bitbucket: mrmuler, ). No success... ln -s /usr/local/lib/python /Library/Frameworks/Python.framework/Versions/2.7/share/sip/ ln: /Library/Frameworks/Python.framework/Versions/2.7/share/sip/: No such file or directory I don't know if I did it right. Correct me if im wrong please |
Original comment by Autobot (Bitbucket: acidjunk, GitHub: acidjunk). I didn't follow the bug for a while now. Because I had a working setup with py2app 0.6.3. I also have a VMARE image with a working setup for OSX 10.7 & PyQT 4.9 / Python 2.7.3. So I don't know if the above patch will work you. Nor do I know enough about you current setup. When I created the ticket I was running (Py)QT and Python from home brew. To make sure the build system had everything needed to distribute the app I installed all deps from homebrew and used python from homebrew also. I didn't know or use PyQTX; but compiled and installed pyqt with homebrew. |
Original comment by Frank Spano (Bitbucket: mrmuler, ). I managed to find the dir and install manually the sip files from the repo, made the ln and that made it. but now I'm stuck with another issue. :S when I try to execute the application from the //dist// folder I get an error. 10/4/12 3:32:11.506 AM window_ui_latest2[27344]: window_ui_latest2 Error does it sound familiar to any of you??? (just asking before I create a ticket) |
Original comment by Ronald Oussoren (Bitbucket: ronaldoussoren, GitHub: ronaldoussoren). See also issue #18. As of today the tip of the tree contains much improved support for PyQt. I'd love to know if this work, and the earlier work by Micheal McCracken on the sip recipe, fixes the problems mentioned in this issue. Could you please this if the tip of the tree fixes the issue for you? |
Original comment by Ronald Oussoren (Bitbucket: ronaldoussoren, GitHub: ronaldoussoren). I'm assuming this issue has been fixed in the 0.7 release, please open a new issue when there are still Qt issues. |
Original report by Autobot (Bitbucket: acidjunk, GitHub: acidjunk).
When using py2app 0.63 everything works OK (building a 64 bit app for 10.6 & 10.7). With py2app 0.64 I'm getting this error when trying to build my app.
running py2app
creating /Users/acidjunk/Desktop/njoy/QTplayer/build
creating /Users/acidjunk/Desktop/njoy/QTplayer/build/bdist.macosx-10.4-x86_64
creating /Users/acidjunk/Desktop/njoy/QTplayer/build/bdist.macosx-10.4-x86_64/python2.7-standalone
creating /Users/acidjunk/Desktop/njoy/QTplayer/build/bdist.macosx-10.4-x86_64/python2.7-standalone/app
creating /Users/acidjunk/Desktop/njoy/QTplayer/build/bdist.macosx-10.4-x86_64/python2.7-standalone/app/collect
creating /Users/acidjunk/Desktop/njoy/QTplayer/build/bdist.macosx-10.4-x86_64/python2.7-standalone/app/temp
creating /Users/acidjunk/Desktop/njoy/QTplayer/dist
creating build/bdist.macosx-10.4-x86_64/python2.7-standalone/app/lib-dynload
creating build/bdist.macosx-10.4-x86_64/python2.7-standalone/app/Frameworks
*** using recipe: virtualenv ***
error: /usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/2.7/share/sip: No such file or directory
I'm running OS X 10.7 with python and qt from homebrew. I tried the py2app 0.63 version because that's what I used on my old builder mac (OSX 10.6). I describe the old build environment here: http://www.renedohmen.nl/blog/2011/11/installing-pyqt4-on-mac-osx/
The text was updated successfully, but these errors were encountered: