gpt4 book ai didi

python - PyQt5的PyQt5.sip文件不是由SIP库生成的

转载 作者:行者123 更新时间:2023-11-28 17:04:08 28 4
gpt4 key购买 nike

我正在使用 Visual Studio 2017 在 Windows 10 上构建 SIP 4.19.12 和 PyQt 5.11.2。我计划为 Python x86 2.7.15 执行此操作。我下载了上面的版本并解压了它们,用 pip 安装了 enum34,用

配置了 SIP
python configure.py --sip-module PyQt5.sip --no-tools

这是适用于 win32 上的 Python 2.7.15 的 SIP 4.19.12。

The PyQt5.sip module will be installed in

C:\Users\FiFo\AppData\Local\Programs\Python\Python27\Lib\site-packages\PyQt5.

The sip.pyi stub file will be installed in

C:\Users\FiFo\AppData\Local\Programs\Python\Python27\Lib\site-packages\PyQt5.

The default directory to install .sip files in is

C:\Users\FiFo\AppData\Local\Programs\Python\Python27\sip. Creating

sipconfig.py... Creating top level Makefile... Creating sip code

generator Makefile... Creating sip module Makefile...

设置 x86 构建环境

"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x86

接着是nmake:

Microsoft (R) Program Maintenance Utility Version 14.15.26729.0 Copyright (C) Microsoft Corporation. All rights reserved.

    cd siplib
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.15.26726\bin\HostX86\x86\nmake.exe

Microsoft (R) Program Maintenance Utility Version 14.15.26729.0 Copyright (C) Microsoft Corporation. All rights reserved.

    cl -c -nologo -Zm200 -Zc:wchar_t- -O2 -MD -W3 -DNDEBUG -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DSIP_MODULE_NAME=\"PyQt5.sip\" -I. -IC:\Users\FiFo\AppData\Local\Programs\Python\Python27\include -Fo @C:\Users\FiFo\AppData\Local\Temp\nm8C0F.tmp siplib.c apiversions.c

descriptors.c qtlib.c threads.c objmap.c voidptr.c array.c

int_convertors.c Generating Code...

    cl -c -nologo -Zm200 -Zc:wchar_t- -O2 -MD -W3 -w34100 -w34189 -DNDEBUG -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DSIP_MODULE_NAME=\"PyQt5.sip\" -I. -IC:\Users\FiFo\AppData\Local\Programs\Python\Python27\include -Fo @C:\Users\FiFo\AppData\Local\Temp\nm9111.tmp bool.cpp

link /NOLOGO /DYNAMICBASE /NXCOMPAT /DLL /MANIFEST /MANIFESTFILE:sip.pyd.manifest /SUBSYSTEM:CONSOLE /INCREMENTAL:NO

/OUT:sip.pyd @C:\Users\FiFo\AppData\Local\Temp\nm9170.tmp Creating

library sip.lib and object sip.exp

    mt -nologo -manifest sip.pyd.manifest -outputresource:sip.pyd;2

然后使用 nmake install 安装软件包:

Microsoft (R) Program Maintenance Utility Version 14.15.26729.0 Copyright (C) Microsoft Corporation. All rights reserved.

    cd siplib
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.15.26726\bin\HostX86\x86\nmake.exe"

install

Microsoft (R) Program Maintenance Utility Version 14.15.26729.0 Copyright (C) Microsoft Corporation. All rights reserved.

    copy /y sip.pyd C:\Users\FiFo\AppData\Local\Programs\Python\Python27\Lib\site-packages\PyQt5\sip.pyd
1 file(s) copied.
copy /y D:\opencv\sip-4.19.12\sip.pyi C:\Users\FiFo\AppData\Local\Programs\Python\Python27\Lib\site-packages\PyQt5\sip.pyi
1 file(s) copied.
C:\Users\FiFo\AppData\Local\Programs\Python\Python27\python.exe

D:\opencv\sip-4.19.12\mk_distinfo.py "" C:\Users\FiFo\AppData\Local\Programs\Python\Python27\Lib\site-packages\PyQt5_sip-4.19.12.dist-info installed.txt

D:\opencv\sip-4.19.12\sipgen>pip freeze

backports.functools-lru-cache==1.5 cycler==0.10.0 enum34==1.1.6 kiwisolver==1.0.1 matplotlib==2.2.3 numpy==1.15.1 Pillow==5.2.0 pynaoqi==2.1.4.13 pyparsing==2.2.0 PyQt5-sip==4.19.12 python-dateutil==2.7.3 pytz==2018.5 six==1.11.0

但我无法在任何地方找到 PyQt5.sip 文件。构建 PyQt 提供:

D:\opencv\PyQt5_gpl-5.11.2>python configure.py Querying qmake about your Qt installation... Error: Unable to import PyQt5.sip. Make sure you have configured SIP to create a private copy of the sip module.

最佳答案

这是稳定版的一个错误。作者建议下载有效的最新快照。另一种解决方案是:

“在包含 sip.pyd 的同一目录中创建一个空的 __init__.py 文件。”

之后我配置了:

python configure.py --qmake d:\qt5_32\bin\qmake.exe --static --sip-incdir ..\sip-4.19.13.dev1809111822\siplib --sip d:\opencv\sip-4.19.13.dev1809111822\sipgen\sip.exe --confirm-license

关于python - PyQt5的PyQt5.sip文件不是由SIP库生成的,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52360073/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com