Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing PySide for Python3

When I try to install PySide for Python-3.6, it says it is only compatible until Python-3.4. Is there any work-around to get it installed for Python-3.6?

Only these Python versions seem to be supported:

[(2, 6), (2, 7), (3, 2), (3, 3), (3, 4)].
like image 562
proy Avatar asked Nov 18 '17 05:11

proy


People also ask

Does PySide support Python 3?

Long story short, the answer is yes and it can be installed with hombrew.

What is PySide package?

PySide is a Python binding of the cross-platform GUI toolkit Qt developed by The Qt Company, as part of the Qt for Python project. It is one of the alternatives to the standard library package Tkinter. Like Qt, PySide is free software. PySide supports Linux/X11, macOS, and Microsoft Windows. PySide.

What is the difference between PyQt and PySide?

The key difference in the two versions — in fact the entire reason PySide2 exists — is licensing. PyQt5 is available under a GPL or commercial license, and PySide2 under a LGPL license.


1 Answers

To get the latest PySide, install one of the official binary wheels from PyPI which includes a bundled Qt and is therefore fully portable.

  • For Qt5 - [Python 2.7 / Python >= 3.5]:

      pip install pyside2
    
  • For Qt6 - [Python >= 3.6]:

      pip install pyside6
    

The information presented in the section below relates to PySide-1.2/Qt4 and is no longer relevant unless you need to support legacy systems.

Firstly, it should be pointed out that PySide depends on Qt4, which is no longer officially supported (as of December 2015). In consequence, all development efforts are now focused on PySide2 and Qt5. According to this tracker issue, there are no plans for officially supporting PySide beyond Python-3.4 - mainly due to lack of resources and the difficulty of compiling on Windows. The current position (as of February 2017), seems to be summed up by this post:

This was last left as basically a wontfix, as one needs to modify both Qt 4.8 and PySide sources to compile with the compiler used for Python 3.5 on Windows. Furthermore, Qt 4.8 is no longer supported, and PySide should not be used for new projects. PySide2, the next version, is the future of Python and Qt, and supports Python 3.5. You can find out more about it on the Qt Wiki.

Having said all that, there are several Linux distros that currently maintain PySide packages for Python-3.5 and/or Python-3.6. This usually only requires a small patch to the shiboken tool which generates the bindings (see the Arch Linux PKGBUILD, for example). In addition, there are Windows wheels available on Christoph Gohlke's Unofficial Windows Binaries site. (I'm afraid I don't know much about the situation for Mac, but I did find this wheel for Python-3.5).

So PySide itself is still currently compatible with Python-3.5 & 3.6 - but the official installers aren't. However, if you're willing to patch the toolchain or use unofficial binaries, this shouldn't be a problem. Effectively, PySide and Qt4 are now frozen codebases, so unless there are some really radical changes made to Python, it "should" remain viable for several releases to come. The future is PySide2, though.

like image 98
ekhumoro Avatar answered Oct 23 '22 15:10

ekhumoro