16

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)].
ekhumoro
  • 115,249
  • 20
  • 229
  • 336
proy
  • 261
  • 1
  • 2
  • 3

1 Answers1

26

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.

ekhumoro
  • 115,249
  • 20
  • 229
  • 336
  • I might wish it were different, but at least that seems to sum up the current (somewhat woeful?) state of Python graphics on the Mac, where the necessity to use framework builds is a plague. Fortunately graphics run quite well (and build more easily) on a Linux virtual. – holdenweb Jan 27 '18 at 14:34
  • @holdenweb. Surely the situation must be much better with pyqt on mac, than for pyside? Then again, I suppose pyqt may be out of the question for you, due to licencing issues... It would help if you gave more details on your specific requirements. I think I have answered as best I can regarding the question of general compatibilty with python (which is all you originally asked for). Is there some other way I could try to improve my answer? – ekhumoro Jan 27 '18 at 17:51
  • tbh I've got tired of trying to sort out a combination of technologies that works. Suppose I want to test from virtual environments based on different Python builds? The more information you can add the better, but it looks like yo have enough knowledge to earn the bonus. – holdenweb Jan 27 '18 at 21:57
  • @holdenweb. So is pyside + qt4 the only realistic choice for you? Because given the current legacy status of these libraries, I don't think there's much more to be said. Personally, I would be very reluctant to start a *new* project that depended on two such large libraries with no official support. Existing projects are okay, because they already know where the bugs are, and can work around them. But what if you get half-way in and find a show-stopper? If you want to use python + qt, the only sensible choice is pyqt5 or pyside2 (which will hopefully have its first official release this year). – ekhumoro Jan 27 '18 at 22:23
  • So in other words, I can choose between an obsolete library and an unreleased one? In fact I was asking about `pyside` in the generic sense, and was unaware that the second generation was under development. If the "current position" is represented by a year old statement the project clearly needs help.This appears to reflect the parlous state of open source graphics support generally. – holdenweb Jan 28 '18 at 08:38
  • @holdenweb. The "current position" makes a pretty clear distinction between pyside/qt4 and pyside2/qt5. I also spelled all that out in the opening paragraph of my answer. Wherever I use "pyside", it means strictly qt4-only and no official support beyond python-3.4; and wherever I use "pyside2", that means qt5-only and official support for python-3.5 and greater. The linked wiki page shows that the pyside2 project is fully active. More importantly, since april 2016, pyside2 is also [fully supported by the qt company itself](https://groups.google.com/forum/#!topic/pyside-dev/pqwzngAGLWE). – ekhumoro Jan 28 '18 at 17:36
  • @holdenweb. I don't understand what you mean by "parlous state of open source graphics support generally". You can use pyqt4/5 with python-2.7 - python-3.x *right now* for a GPL open source project. It has complete cross-platform support and is very proactively maintained. In the near future, you will also have the option of LGPL with pyside2/qt5/python3. It's unfortunate that pyside is currently in transition. When nokia sold qt to digia, pyside lost its entire dev team. But thanks mainly to the efforts of Christian Tismer, they are now re-building. – ekhumoro Jan 28 '18 at 17:55
  • I wasn't aware of the distinction between pyside and pyside2 until I saw your answer. It doesn't seem fair to call a package that doesn't support 3.5 or 3.6 "proactively maintained," but I suppose that's a matter of opinion. Neither did I know the development team history. I know Chris Tismer to be a highly competent engineer. – holdenweb Jan 28 '18 at 20:32
  • @holdenweb. I said that [**pyqt4/5**](https://www.riverbankcomputing.com/software/pyqt/download5) is proactively maintained, which is a completely different project to pyside. And pyside2 **does** support python-3.5 & 3.6, as I have pointed out several times already. – ekhumoro Jan 28 '18 at 20:37
  • Ah, right. All that being said, you are clearly up to speed on the state of the pyside(2)/Qt world, and I thank you for your input. – holdenweb Jan 28 '18 at 20:39