[PyQt] com.apple.xbs Error-- Please help- Thank you
Barry
barry at barrys-emacs.org
Sun Mar 26 22:00:25 BST 2017
I don't use an IDE.
I use Barry's Emacs and the editor and a terminal shell to ru the code.
It seems the IDE is getting in your way.
The menus are exactly as expected on macOS as I remarked.
Barry
> On 26 Mar 2017, at 20:26, Grant Fraser <grantrf93 at hotmail.com> wrote:
>
> That is extremely odd.
>
>
> Site with tutorials: https://pythonspot.com/en/pyqt5/
> Menu code that causes error for me https://pythonspot.com/en/pyqt5-menu/
> PyQT5 – Python Tutorial
> pythonspot.com
> PyQt5 is a module that can be used to create graphical user interfaces (GUI). PyQt5 is not backwards compatible with PyQt4. You will need Python 2.6+ or newer.
> I am on a Mac 10.12.3
> Python 3.6
>
> The file partially works in terminal but not in PyCharm. The only menu bar items I receive are "python3" and "edit" though. They load extremely slowly and I am on a really good laptop.
> Screenshots attached.
>
> How many menu bar items do you receive ?
> No view, tools, search, or help menu bar items, like the program seems to supposedly create.
>
> I do not know why I am not receiving all of the menu bar items.
>
> In PyCharm the full error I receive is http://pastebin.com/RJ3gnrAT
>
> Process: Python [9764] Path: /usr/local/Cellar/p - Pastebin.com
> pastebin.com
>
> Additionally have you tried running this program in one of your IDEs without errors?
>
> Thanks a bunch,
>
> Grant
>
> From: Barry Scott <barry at barrys-emacs.org>
> Sent: Sunday, March 26, 2017 7:41 AM
> To: Grant Fraser
> Cc: pyqt at riverbankcomputing.com
> Subject: Re: [PyQt] com.apple.xbs Error-- Please help- Thank you
>
>
>> On 25 Mar 2017, at 17:25, Grant Fraser <grantrf93 at hotmail.com> wrote:
>>
>> Mac OS Python 3 PyQt5
>> Program that causes error from tutorial but 'works' for the site owner (http://zetcode.com/gui/pyqt5/menustoolbars/):
>
> I ran the code in your email and it works error free.
>
> macOs 10.12.3
> python 3.5.2 and 3.6.0 with PyQt5 5.7 and 5.8.1
>
> What versions are you using?
>
> I put your code into file a.py and run it from the command line as:
>
> $ python3.6 a.py
>
> Note: that this example bumps into macOS specific handling of menus.
>
> The File>Exit menu is automatically moved to the Python menu as Quit with Cmd-Q as the short cut the icon does show up.
>
> Barry
>
>>
>> Menus and toolbars in PyQt5 - ZetCode
>> zetcode.com
>> Menus and toolbars in PyQt5. In this part of the PyQt5 tutorial, we will create menus and toolbars. A menu is a group of commands located in a menubar.
>>
>> import sys
>> from PyQt5.QtWidgets import QMainWindow, QAction, qApp, QApplication
>> from PyQt5.QtGui import QIcon
>>
>>
>> class Example(QMainWindow):
>> def __init__(self):
>> super().__init__()
>>
>> self.initUI()
>>
>> def initUI(self):
>> exitAction = QAction(QIcon('exit.png'), '&Exit', self)
>> exitAction.setShortcut('Ctrl+Q')
>> exitAction.setStatusTip('Exit application')
>> exitAction.triggered.connect(qApp.quit)
>>
>> self.statusBar()
>>
>> menubar = self.menuBar()
>> fileMenu = menubar.addMenu('&File')
>> fileMenu.addAction(exitAction)
>>
>> self.setGeometry(300, 300, 300, 200)
>> self.setWindowTitle('Menubar')
>> self.show()
>>
>>
>> if __name__ == '__main__':
>> app = QApplication(sys.argv)
>> ex = Example()
>> sys.exit(app.exec_())
>> Error:
>> 2017-03-23 23:25:08.606 Python[96170:2827344] *** Assertion failure in -[NSBitmapImageRep initWithCGImage:], /Library/Caches/com.apple.xbs/Sources/AppKit/AppKit-1504.81.100/AppKit.subproj/NSBitmapImageRep.m:1296
>> 2017-03-23 23:25:08.608 Python[96170:2827344] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: cgImage != NULL'
>> *I have looked everywhere for this com.apple.xbs folder, including other computers. I cannot find it anywhere on other computers or online. What is the issue? Apparently it is only for developers? I have signed up as a developer and still cannot find it. I do not see the correlation between apple and this PyQt5 program though. I also do not see anywhere in the code that would mention needing this folder.
>> *I have even checked hidden folders.
>> *Perhaps you could try running it yourself and seeing if you get the same error. I would really appreciate any help. Thank you.
>>
>> _______________________________________________
>> PyQt mailing list PyQt at riverbankcomputing.com
>> https://www.riverbankcomputing.com/mailman/listinfo/pyqt
>
> <Screen Shot 2017-03-26 at 2.22.23 PM.png>
> <Screen Shot 2017-03-26 at 2.22.15 PM.png>
> <Screen Shot 2017-03-26 at 2.21.47 PM.png>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20170326/edfb747f/attachment.html>
More information about the PyQt
mailing list