Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #98465

Re: [Ubuntu] PyQt5

From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Subject Re: [Ubuntu] PyQt5
Date 2015-11-09 03:22 +1100
Message-ID <mailman.139.1446999736.16136.python-list@python.org> (permalink)
References <d453cf4b-7a30-4b2c-9bff-53d488552671@googlegroups.com> <7056c802-308b-4d5c-961d-052ef2671633@googlegroups.com>

Show all headers | View raw


On Mon, Nov 9, 2015 at 3:03 AM, Andrew Diamond <adiamond1978@gmail.com> wrote:
> 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, whenever I click one of the buttons or menus in the example apps I run that is supposed to quit the application, it locks up.  This happens with all the examples 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 <module>
>     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

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[Ubuntu] PyQt5 Andrew Diamond <adiamond1978@gmail.com> - 2015-11-07 19:13 -0800
  Re: [Ubuntu] PyQt5 Vincent Vande Vyvre <vincent.vande.vyvre@telenet.be> - 2015-11-08 06:36 +0100
  Re: [Ubuntu] PyQt5 Laura Creighton <lac@openend.se> - 2015-11-08 11:20 +0100
  Re: [Ubuntu] PyQt5 Andrew Diamond <adiamond1978@gmail.com> - 2015-11-08 08:03 -0800
    Re: [Ubuntu] PyQt5 Chris Angelico <rosuav@gmail.com> - 2015-11-09 03:22 +1100
      Re: [Ubuntu] PyQt5 Andrew Diamond <adiamond1978@gmail.com> - 2015-11-08 08:27 -0800
    Re: [Ubuntu] PyQt5 Terry Reedy <tjreedy@udel.edu> - 2015-11-08 18:05 -0500
    Re: [Ubuntu] PyQt5 Laura Creighton <lac@openend.se> - 2015-11-09 03:41 +0100
    Re: [Ubuntu] PyQt5 Terry Reedy <tjreedy@udel.edu> - 2015-11-09 05:24 -0500

csiph-web