Maya 2017 is moving to QT 5.6.1 and PySide2. PySide2 is currently still in alpha stage, so it's not as stable as it could be. We will continue to update it in our service packages. However, if you want to upgrade yourself, you can download and build it easily.
Maya 2017 is built with MSVC2012, so we cannot introduce other vc runtime in our build environment. So we will build QT 5.6.1 with MSVC2012 and the Python shipped with Maya.
It's a good idea to backup the Pyside2 files shipped with Maya before you are trying to replace them.
Here is a list:
Maya2017/bin/pyside2.dll
Maya2017/bin/pyside2-uic
Maya2017/bin/shiboken2.dll
Maya2017/lib/pyside2.lib
Maya2017/lib/shiboken2.lib
Maya2017/Python/Lib/site-packages/shiboken2.pyd
Maya2017/Python/Lib/site-packages/PySide2
Maya2017/Python/Lib/site-packages/pyside2uic
Let's begin to build PySide2 now. First, you'll need to download the source code of QT 5.6.1 and compile it with MSVC2012 64bit. You can find our modified QT package here and check the guide for building and installing customized QT 5.6.1 on windows.
Then you'll need to get the latest code from the PySide2 repo. For example:
git clone https://codereview.qt-project.org/pyside/pyside-setup --branch dev --recursive
After cloning the repo, we need to prepare for MayaPy. First, create a folder named Libs inside of Maya2017/Python folder then copy python27.lib from Maya2017/lib into it. Copy Maya2017/include/python2.7 into Maya2017/Python also. After that, we can build Pyside2 with following command in VS2012 x64 native tools :
mayapy.exe setup.py build --ignore-git --qmake=%QT5.6.1_MSVC2012_BuildPath%\qmake.exe --cmake="C:\Program Files (x86)\CMake\bin\cmake.exe" --jobs=9 --jom
We are using CMake 3.3.x here. JOM is a parallel build tool for QT, you can download it from QT's website or inside of QtCreator. Please make sure you've added JOM's path into your path environment variable.
It will take about 10 minutes to build Pyside2. Once it is done, go to pyside_install folder and replace the Maya2017\bin folder with the files inside the pyside_install\py2.7-qt5.6.1-64bit-release\bin folder;Maya2017\Python\lib\site-packages with pyside_install\py2.7-qt5.6.1-64bit-release\lib\site-packages and Maya2017\lib with the files in pyside_install\py2.7-qt5.6.1-64bit-release\lib.
Please make sure to backup the original file, as if there is any other issues caused by the replacement, you can use the original file to revert this workaround.
Hi there,
We are trying to build PySide2 for Python 2.7 in Win 10. We managed to compile to a wheel where you would have to have Qt installed on the system. We would like to compile to where Qt does not need to be installed on the system to use PySide2.
Would we follow the same steps outlined above, but instead of using mayapy, we would use the python 2.7 executable?
It's hard to find info on this as it stands right now, so any information on this would be very helpful. There must be many studios, that want to build a PySide2 installer that does not require Qt to be installed.
Thanks for putting solid information out there,
Christian Akesson | Senior Technical Artist | Daybreak Games
Posted by: Christian Akesson | September 16, 2016 at 02:15 PM
I have to say that for someone that is not familiar with compiling Qt the bundled instructions in "howToBuildQtOnWindows_m2017.txt" are severely lacking.
What is the "icu53_1" reference?
What is "your normal options" for configure.exe?
The general tone of the instructions makes me feel like they were written for people who does this stuff on a frequent basis.
I would really appreciate a better set of instructions.
Posted by: Martin Karlsson | September 16, 2016 at 02:55 PM
Instructions says "See https://doc-snapshots.qt.io/qt5-5.4/windows-building.html for Qt building notes" but that page is a 404.
Posted by: Martin Karlsson | September 16, 2016 at 03:58 PM
Getting below warnings- can someone please help clarify:
C:\qt\qt-adsk-5.6.1\qtbase\src\network\access\qnetworkaccessdebugpipebackend_p.h(0): Note: No relevant classes found. No output generated.
cl : Command line warning D9002 : ignoring unknown option '-arch:SSE2'
cl : Command line warning D9002 : ignoring unknown option '-arch:SSE2'
cl : Command line warning D9002 : ignoring unknown option '-arch:SSE2'
cl : Command line warning D9002 : ignoring unknown option '-arch:SSE2'
cl : Command line warning D9002 : ignoring unknown option '-arch:SSE2'
C:\qt\qt-adsk-5.6.1\qtbase\src\network\access\qnetworkaccessdebugpipebackend_p.h(0): Note: No relevant classes found. No output generated.
cl : Command line warning D9002 : ignoring unknown option '-arch:SSE2'
cl : Command line warning D9002 : ignoring unknown option '-arch:SSE2'
cl : Command line warning D9002 : ignoring unknown option '-arch:SSE2'
cl : Command line warning D9002 : ignoring unknown option '-arch:SSE2'
cl : Command line warning D9002 : ignoring unknown option '-arch:SSE2'
Checking for ntddmodm... no
Checking for jasper... no
Checking for libmng... no
Checking for libtiff... no
Checking for libwebp... no
Checking for language... no
Checking for socketcan... no
Checking for socketcan_fd... no
Project WARNING: Cannot compile the module with your compiler, missing C++11 language features.
Posted by: Martin Karlsson | September 16, 2016 at 06:36 PM
After a full day of tinkering I got a Qt build done; however, when I try to compile PySide2 it seems like the build is bad.
Get errors about missing dll files in the "...qt-build-561\qtbase\bin\..." directory and the below error [note the messed up filepath "C:/qt/qt-build-561/qtbase/C:/qt/qt-adsk-5.6.1/qtbase//mkspecs/win32-msvc2012"]:
[Start error]
CMake Error at C:/qt/qt-build-561/qtbase/lib/cmake/Qt5Core/Qt5CoreConfig.cmake:15 (message):
The imported target "Qt5::Core" references the file
"C:/qt/qt-build-561/qtbase/C:/qt/qt-adsk-5.6.1/qtbase//mkspecs/win32-msvc2012"
but this file does not exist. Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
"C:/qt/qt-build-561/qtbase/lib/cmake/Qt5Core/Qt5CoreConfigExtras.cmake"
but not all the files it references.
[End error]
Posted by: Martin Karlsson | September 16, 2016 at 11:14 PM
Hi,
I was in training last week. I'll look at this issue this week.
Yours,
Li
Posted by: Chengxi Li | September 26, 2016 at 12:38 AM
Hi Christian,
Using python 2.7 should be OK. But we recommend to use Python built with VS2012 to avoid any potential runtime issues. That's the reason why I am using mayapy.
I think you can't build PySide without a QT environment. But once it is built, you can copy the binary outputs to other computers you need.
Yours,
Li
Posted by: Chengxi Li | September 27, 2016 at 08:09 PM