我正在尝试构建 PyQt5,但是,我不断收到它需要 sip 4.19.1 或更高版本的错误。
我尝试过使用“--sip”、“--sipdir”和“--sip-incdir”,但是这些似乎都不起作用。
我通过运行“python configure.py”->“nmake”->“nmake install”安装了 sip,并且运行这些时没有错误。
C:\Users\Tarzan\Downloads\sip-4.19.2>nmake install
Microsoft (R) Program Maintenance Utility Version 14.00.24210.0
Copyright (C) Microsoft Corporation. All rights reserved.
cd sipgen
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\nmake.exe" install
Microsoft (R) Program Maintenance Utility Version 14.00.24210.0
Copyright (C) Microsoft Corporation. All rights reserved.
copy /y sip.exe C:\ProgramData\Anaconda3\sip.exe
1 file(s) copied.
cd siplib
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\nmake.exe" install
Microsoft (R) Program Maintenance Utility Version 14.00.24210.0
Copyright (C) Microsoft Corporation. All rights reserved.
copy /y sip.pyd C:\ProgramData\Anaconda3\Lib\site-packages\sip.pyd
1 file(s) copied.
copy /y C:\Users\Tarzan\Downloads\sip-4.19.2\siplib\sip.h C:\ProgramData\Anaconda3\include\sip.h
1 file(s) copied.
copy /y C:\Users\Tarzan\Downloads\sip-4.19.2\sip.pyi C:\ProgramData\Anaconda3\Lib\site-packages\sip.pyi
1 file(s) copied.
copy /y sipconfig.py C:\ProgramData\Anaconda3\Lib\site-packages\sipconfig.py
1 file(s) copied.
copy /y C:\Users\Tarzan\Downloads\sip-4.19.2\sipdistutils.py C:\ProgramData\Anaconda3\Lib\site-packages\sipdistutils.py
1 file(s) copied.
下面是运行配置文件的尝试
C:\Users\Tarzan\Downloads\PyQt5_gpl-5.8.2>python configure.py
Querying qmake about your Qt installation...
Determining the details of your Qt installation...
This is the GPL version of PyQt 5.8.2 (licensed under the GNU General Public
License) for Python 3.6.0 on win32.
Type 'L' to view the license.
Type 'yes' to accept the terms of the license.
Type 'no' to decline the terms of the license.
Do you accept the terms of the license? yes
Found the license file pyqt-gpl.sip.
Error: This version of PyQt5 requires sip 4.19.1 or later.
我已经在谷歌上搜索了大约一两个小时,但发布的解决方案似乎都不起作用。
注意:使用了 Visual C++ 2015 x64 native 构建工具命令提示符
结果当我尝试运行python configure.py --sip <path>
时我以前选择了错误的道路。但现在它正在工作。
我是一名优秀的程序员,十分优秀!