Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Chris Angelico Newsgroups: comp.lang.python Subject: Re: [Ubuntu] PyQt5 Date: Mon, 9 Nov 2015 03:22:07 +1100 Lines: 45 Message-ID: References: <7056c802-308b-4d5c-961d-052ef2671633@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: news.uni-berlin.de AUFUl1JK+OC+/zq6ict5vw8YSy6q8mjJk5ZmqGfOiLpA== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python,': 0.02; 'subject:: [': 0.03; '16,': 0.03; 'received:209.85.223': 0.03; 'importerror:': 0.05; 'python3': 0.05; 'interpreter.': 0.07; 'cc:addr:python-list': 0.09; 'buttons': 0.09; 'issue?': 0.09; 'advance': 0.10; 'python': 0.10; 'package,': 0.13; 'apps': 0.15; ' --version': 0.16; 'assistance!': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'hint': 0.16; 'idle.': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'sudo': 0.16; 'wrote:': 0.16; 'subject:] ': 0.19; '2015': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'fairly': 0.22; '3.x': 0.22; 'trying': 0.22; 'am,': 0.23; "haven't": 0.24; 'import': 0.24; '(most': 0.24; 'examples': 0.24; 'somewhere': 0.24; 'header:In-Reply-To:1': 0.24; 'mon,': 0.24; 'module': 0.25; 'install': 0.25; 'example': 0.26; 'installed': 0.26; 'compare': 0.27; 'separate': 0.27; 'message- id:@mail.gmail.com': 0.27; 'andrew': 0.27; 'locks': 0.29; "i'm": 0.30; 'work.': 0.30; 'code': 0.30; 'supposed': 0.31; 'probably': 0.31; 'post': 0.31; 'another': 0.32; 'up.': 0.32; 'run': 0.33; 'idle': 0.33; 'traceback': 0.33; 'ubuntu': 0.33; 'file': 0.34; 'handle': 0.34; 'running': 0.34; 'info': 0.34; 'received:google.com': 0.35; 'could': 0.35; 'nov': 0.35; 'path': 0.35; 'but': 0.36; 'should': 0.36; 'there': 0.36; 'received:209.85': 0.36; 'two': 0.37; "won't": 0.38; 'version': 0.38; 'received:209': 0.38; 'thank': 0.38; 'some': 0.40; 'your': 0.60; 'saturday,': 0.63; 'more': 0.63; 'latest': 0.64; 'within': 0.64; 'potentially': 0.67; 'click': 0.76; '3.4': 0.84; 'apt-get': 0.84; 'chrisa': 0.84; 'to:none': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type:content-transfer-encoding; bh=Pt8FZCwsHv/w/m/camLC4CNJxuyWSxWsdJhkXSTAd3k=; b=P4w8MBKTm0e8nzc/3/dZ5oHQoNCjNVlkxz8rrUTLdZGDnyJ4/pIUuPGVcNUSJRLtyx dC/KGw8jWGV/UuACkJAGdbPuCP0f7aS6kGc1eGjs1TSXfYNb9uzUgGgmdkMNhDWPTMcV ARk356213+0isUaWWUlR/nK1FTei8lK62K4P1R0397+mG1LOLsdqVaMPNXiDzU+7rTLF 4eRhSGr7c+KSFSM1qXRKDsXVvatMQ7P+jur1nqy+F3Dv/CKzoNRJS1rGyleHbWR+hyP1 S2G663ehE3kqxGbWXm4S8SeUOwBuDtMVvSAi+kzbqaADYWP1uGdGBxR7GEde7EWvTM2H 3TWA== X-Received: by 10.107.10.233 with SMTP id 102mr5393488iok.31.1446999727574; Sun, 08 Nov 2015 08:22:07 -0800 (PST) In-Reply-To: <7056c802-308b-4d5c-961d-052ef2671633@googlegroups.com> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:98465 On Mon, Nov 9, 2015 at 3:03 AM, Andrew Diamond wro= te: > On Saturday, November 7, 2015 at 10:13:25 PM UTC-5, Andrew Diamond wrote: >> Hi! >> >> I'm fairly new to Python, and installed pyqt5 and began working through = the examples at http://zetcode.com/gui/pyqt5/menustoolbars/ However, whene= ver I click one of the buttons or menus in the example apps I run that is s= upposed to quit the application, it locks up. This happens with all the ex= amples I installed that handle code to quit the app. >> >> Running Ubuntu 15.10, and installed pyqt5 via: >> >> sudo apt-get install python3-pyqt5 >> sudo apt-get install qtcreator >> >> Thank you in advance for any assistance! > > I just read somewhere that the issue could be because I was trying to run= these examples from within Idle. However, when I try to run them from the= terminal, I run into another snag: > > andrew@andrew-Satellite-P755:~/Programming/Python$ python tut8.py > Traceback (most recent call last): > File "tut8.py", line 16, in > from PyQt5.QtWidgets import QMainWindow, QAction, qApp, QApplication > ImportError: No module named PyQt5.QtWidgets > > ...a path issue? If you installed "python3-pyqt5", you probably want to run "python3 tut8.py". There are potentially two completely separate Python interpreters installed - version 2.7, and the latest available version 3.x (probably 3.4 or 3.5). You've installed a package for Python 3, but haven't installed the corresponding Python 2 package, so it won't run under the Python 2 interpreter. Compare these: $ python --version $ python3 --version I suspect that "python3 tut8.py" should work. If it doesn't, post some more info about your Idle installation; it might give a hint as to what's going on. ChrisA