Python PyQt5 5.8.2在Windows 10上从源代码生成

Python PyQt5 5.8.2在Windows 10上从源代码生成,python,pyqt,pyqt5,nmake,Python,Pyqt,Pyqt5,Nmake,我正在使用Python3.6、Qt5.8的qmake和VS2017的nmake,试图从源代码构建PyQt5 但是,在执行的第一步中,我遇到了如下错误 python configure.py--verbose: C:\Qt\5.8\msvc2015_64\include\QtCore/qalgorithms.h(593): error C3615: constexpr function 'QAlgorithmsPrivate::qt_builtin_ctz' cannot result in a

我正在使用Python3.6、Qt5.8的qmake和VS2017的nmake,试图从源代码构建PyQt5

但是,在执行的第一步中,我遇到了如下错误

python configure.py--verbose

C:\Qt\5.8\msvc2015_64\include\QtCore/qalgorithms.h(593): error C3615: constexpr function 'QAlgorithmsPrivate::qt_builtin_ctz' cannot result in a constant expression
C:\Qt\5.8\msvc2015_64\include\QtCore/qalgorithms.h(595): note: failure was caused by an uninitialized variable declaration
C:\Qt\5.8\msvc2015_64\include\QtCore/qalgorithms.h(595): note: see usage of 'result'
C:\Qt\5.8\msvc2015_64\include\QtCore/qalgorithms.h(596): note: failure was caused by an illegal statement or expression
C:\Qt\5.8\msvc2015_64\include\QtCore/qalgorithms.h(600): error C3615: constexpr function 'QAlgorithmsPrivate::qt_builtin_clz' cannot result in a constant expression
C:\Qt\5.8\msvc2015_64\include\QtCore/qalgorithms.h(602): note: failure was caused by an uninitialized variable declaration
C:\Qt\5.8\msvc2015_64\include\QtCore/qalgorithms.h(602): note: see usage of 'result'
C:\Qt\5.8\msvc2015_64\include\QtCore/qalgorithms.h(603): note: failure was caused by an illegal statement or expression
.
.
.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\bin\HostX64\x64\cl.EXE"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\bin\HostX64\x64\nmake.exe"' : return code '0x2'
Stop.

注意:我确实在稍后使用
pip install PyQt5
成功安装了PyQt5,它工作正常。但是我无法理解为什么会发生错误,我仍然希望解决它,以避免将来出现同样的问题。

之后,通过VS2015构建和编译似乎工作得很好。

尝试询问PyQt邮件列表上的作者。可能与。您真的需要使用VS2017进行构建吗?因为您使用的是VS2015版本的Qt,所以您可能应该使用相同的版本来构建PyQt,以避免使用多个MSVC运行时。