安装 PyQt 5.4.2 时出错:sip api 参考
Error installing PyQt 5.4.2: sip api reference
我需要帮助来找出出现此错误的原因:
[everything fine until here...]
In file included from sipQtCoreQTimeZoneOffsetData.cpp:24:0:
/home/hugo/Desktop/my_pyqt_examples/PyQt-gpl-5.4.2/QtCore/sipQtCoreQTimeZoneOffsetData.cpp: In function ‘PyObject* varget_QTimeZone_OffsetData_abbreviation(void*, PyObject*, PyObject*)’:
/home/hugo/Desktop/my_pyqt_examples/PyQt-gpl-5.4.2/QtCore/sipAPIQtCore.h:9581:52: error: ‘const sipAPIDef’ has no member named ‘api_get_reference’
#define sipGetReference sipAPI_QtCore->api_get_reference
^
/home/hugo/Desktop/my_pyqt_examples/PyQt-gpl-5.4.2/QtCore/sipQtCoreQTimeZoneOffsetData.cpp:128:13: note: in expansion of macro ‘sipGetReference’
sipPy = sipGetReference(sipPySelf, -13);
^
/home/hugo/Desktop/my_pyqt_examples/PyQt-gpl-5.4.2/QtCore/sipQtCoreQTimeZoneOffsetData.cpp: In function ‘PyObject* varget_QTimeZone_OffsetData_atUtc(void*, PyObject*, PyObject*)’:
/home/hugo/Desktop/my_pyqt_examples/PyQt-gpl-5.4.2/QtCore/sipAPIQtCore.h:9581:52: error: ‘const sipAPIDef’ has no member named ‘api_get_reference’
#define sipGetReference sipAPI_QtCore->api_get_reference
^
/home/hugo/Desktop/my_pyqt_examples/PyQt-gpl-5.4.2/QtCore/sipQtCoreQTimeZoneOffsetData.cpp:170:13: note: in expansion of macro ‘sipGetReference’
sipPy = sipGetReference(sipPySelf, -14);
^
make[1]: *** [sipQtCoreQTimeZoneOffsetData.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory `/home/hugo/Desktop/my_pyqt_examples/PyQt-gpl-5.4.2/QtCore'
make: *** [sub-QtCore-make_first-ordered] Error 2
我正在 Ubuntu 14.04 上的 virtualenv 中安装 PyQt 5.4。我已经安装了 SIP(版本 4.16.8,which sip
returns virtualenv 中的版本)并且在配置期间似乎一切正常 运行:
python configure.py --qmake /home/hugo/Qt/5.4/gcc_64/bin/qmake
输出(除其他外):
Qt v5.4.2 (Open Source) is being used.
The qmake executable is /home/hugo/Qt/5.4/gcc_64/bin/qmake.
Qt is built as a shared library.
SIP 4.16.8 is being used.
The sip executable is /home/hugo/Desktop/my_pyqt_examples/venv/bin/sip.
These PyQt5 modules will be built: QtCore, QtGui, QtHelp, QtMultimedia,
QtMultimediaWidgets, QtNetwork, QtOpenGL, QtPrintSupport, QtQml, QtQuick,
QtSql, QtSvg, QtTest, QtWebKit, QtWebKitWidgets, QtWidgets, QtXml,
QtXmlPatterns, QtDesigner, QtDBus, _QOpenGLFunctions_2_0,
_QOpenGLFunctions_2_1, _QOpenGLFunctions_4_1_Core, QtSensors, QtSerialPort,
QtX11Extras, QtBluetooth, QtPositioning, QtQuickWidgets, QtWebSockets, Enginio,
QtWebChannel, QtWebEngineWidgets.
The PyQt5 Python package will be installed in
/home/hugo/Desktop/my_pyqt_examples/venv/lib/python3.4/site-packages
如果需要更多信息,请告诉我。
我还尝试针对 Ubuntu 存储库的 qt 版本再次安装 PyQt 5.2,但我遇到了同样的错误。我能做什么?
编辑:
我改用 sip 4.16.7
克服了这个问题。但我认为这不是解决方案,所以如果有人知道为什么最新版本不起作用,请详细说明。
我 运行 遇到了同样的问题,我已经通过在 make
步骤之前指定 sip 路径来修复它:
python configure.py --sip-incdir=/opt/sip-4.6.9/include/python2.7
我需要帮助来找出出现此错误的原因:
[everything fine until here...]
In file included from sipQtCoreQTimeZoneOffsetData.cpp:24:0:
/home/hugo/Desktop/my_pyqt_examples/PyQt-gpl-5.4.2/QtCore/sipQtCoreQTimeZoneOffsetData.cpp: In function ‘PyObject* varget_QTimeZone_OffsetData_abbreviation(void*, PyObject*, PyObject*)’:
/home/hugo/Desktop/my_pyqt_examples/PyQt-gpl-5.4.2/QtCore/sipAPIQtCore.h:9581:52: error: ‘const sipAPIDef’ has no member named ‘api_get_reference’
#define sipGetReference sipAPI_QtCore->api_get_reference
^
/home/hugo/Desktop/my_pyqt_examples/PyQt-gpl-5.4.2/QtCore/sipQtCoreQTimeZoneOffsetData.cpp:128:13: note: in expansion of macro ‘sipGetReference’
sipPy = sipGetReference(sipPySelf, -13);
^
/home/hugo/Desktop/my_pyqt_examples/PyQt-gpl-5.4.2/QtCore/sipQtCoreQTimeZoneOffsetData.cpp: In function ‘PyObject* varget_QTimeZone_OffsetData_atUtc(void*, PyObject*, PyObject*)’:
/home/hugo/Desktop/my_pyqt_examples/PyQt-gpl-5.4.2/QtCore/sipAPIQtCore.h:9581:52: error: ‘const sipAPIDef’ has no member named ‘api_get_reference’
#define sipGetReference sipAPI_QtCore->api_get_reference
^
/home/hugo/Desktop/my_pyqt_examples/PyQt-gpl-5.4.2/QtCore/sipQtCoreQTimeZoneOffsetData.cpp:170:13: note: in expansion of macro ‘sipGetReference’
sipPy = sipGetReference(sipPySelf, -14);
^
make[1]: *** [sipQtCoreQTimeZoneOffsetData.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory `/home/hugo/Desktop/my_pyqt_examples/PyQt-gpl-5.4.2/QtCore'
make: *** [sub-QtCore-make_first-ordered] Error 2
我正在 Ubuntu 14.04 上的 virtualenv 中安装 PyQt 5.4。我已经安装了 SIP(版本 4.16.8,which sip
returns virtualenv 中的版本)并且在配置期间似乎一切正常 运行:
python configure.py --qmake /home/hugo/Qt/5.4/gcc_64/bin/qmake
输出(除其他外):
Qt v5.4.2 (Open Source) is being used.
The qmake executable is /home/hugo/Qt/5.4/gcc_64/bin/qmake.
Qt is built as a shared library.
SIP 4.16.8 is being used.
The sip executable is /home/hugo/Desktop/my_pyqt_examples/venv/bin/sip.
These PyQt5 modules will be built: QtCore, QtGui, QtHelp, QtMultimedia,
QtMultimediaWidgets, QtNetwork, QtOpenGL, QtPrintSupport, QtQml, QtQuick,
QtSql, QtSvg, QtTest, QtWebKit, QtWebKitWidgets, QtWidgets, QtXml,
QtXmlPatterns, QtDesigner, QtDBus, _QOpenGLFunctions_2_0,
_QOpenGLFunctions_2_1, _QOpenGLFunctions_4_1_Core, QtSensors, QtSerialPort,
QtX11Extras, QtBluetooth, QtPositioning, QtQuickWidgets, QtWebSockets, Enginio,
QtWebChannel, QtWebEngineWidgets.
The PyQt5 Python package will be installed in
/home/hugo/Desktop/my_pyqt_examples/venv/lib/python3.4/site-packages
如果需要更多信息,请告诉我。 我还尝试针对 Ubuntu 存储库的 qt 版本再次安装 PyQt 5.2,但我遇到了同样的错误。我能做什么?
编辑:
我改用 sip 4.16.7
克服了这个问题。但我认为这不是解决方案,所以如果有人知道为什么最新版本不起作用,请详细说明。
我 运行 遇到了同样的问题,我已经通过在 make
步骤之前指定 sip 路径来修复它:
python configure.py --sip-incdir=/opt/sip-4.6.9/include/python2.7