Results 1 to 5 of 5

Thread: PyQt5 only for python3?

  1. #1
    Join Date
    Jul 2011
    Location
    /Europe/Netherlands
    Beans
    384
    Distro
    Kubuntu 14.04 Trusty Tahr

    PyQt5 only for python3?

    I'm looking for the PyQt5 packages on Ubuntu and I can't find a package for python 2.x For Qt4 there is python-qt4 but there is no package named python-qt5. There is a package called python3-qt5. Is this Ubuntu's way to tell me to move on to Python3 ? Or should I just stick with Qt4? I haven't really 'invested' in Qt yet so at this point I think it's better to get familiar with the latest version of Qt.
    "I believe humans get a lot done, not because we're smart, but because we have thumbs so we can make coffee." --Flash Rosenberg
    formerly 'known' as Euroman

  2. #2
    Join Date
    Jul 2011
    Location
    /Europe/Netherlands
    Beans
    384
    Distro
    Kubuntu 14.04 Trusty Tahr

    Re: PyQt5 only for python3?

    *bump*
    "I believe humans get a lot done, not because we're smart, but because we have thumbs so we can make coffee." --Flash Rosenberg
    formerly 'known' as Euroman

  3. #3
    Join Date
    Apr 2007
    Location
    Newburyport, MA
    Beans
    366
    Distro
    Kubuntu 9.10 Karmic Koala

    Re: PyQt5 only for python3?

    Canonical is trying to ditch python2.x, and it's about time. There are very few libraries worth using that don't work with python3 at this point. I developed a python2 program around 2000 lines long, more or less, using qt5. I initially decided to write it in python2 because for some reason, the python3 version didn't have a way to convert UI files to python3 (at least in Arch it doesn't). I decided I needed to switch to python3 because distros like ubuntu don't support pyqt5 on python3. Amazingly, I only needed to modify about 5 lines of code to make it work, and only 1 or 2 of those lines were Qt specific.

    So in short, just switch to python3.
    Check out my website for programs and games I made for linux:
    http://zicronsoft.comxa.com

  4. #4
    Join Date
    Jul 2011
    Location
    /Europe/Netherlands
    Beans
    384
    Distro
    Kubuntu 14.04 Trusty Tahr

    Re: PyQt5 only for python3?

    Thanks. I'll go with python3.
    "I believe humans get a lot done, not because we're smart, but because we have thumbs so we can make coffee." --Flash Rosenberg
    formerly 'known' as Euroman

  5. #5
    Join Date
    Oct 2013
    Beans
    1

    Re: PyQt5 only for python3?

    I think that the PyQt5 binding is compatible with Python 2.6+.

    The problem you are experiencing is that Ubuntu still includes and segregates Python 2.7 from Python3, and installs package python3-pyqt5 with Python 3 packages. But if you just type 'python' on a command line, you get Python2.7 and it can't find the PyQt5 module since it is installed with the Python3 modules.

    (It seems inconsistent that Ubuntu makes Python2.7 the default python version (when you just enter 'python') but doesn't package PyQt5 that installs with Python2.7?)

    I don't think it is hard to download PyQt5 source from the vendor, build, and install it yourself. (In my experience, it is bullet proof.) Except that you must download and install both SIP and PyQt, and you must be sure that you are using the python version you want (Python 2.7) when you finally install it (when you invoke >python setup.py install.)

    But the other poster is correct, you might as well switch to Python 3, and the more people who fight inertia and do so, the sooner this mess will be history.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •