PyQt5 error during "python3 configure.py": fatal error: 'qgeolocation.h' file not found

时间:2015-10-30 23:07:13

标签: python macos pyqt5

MAC OSX 10.9, Python 3.5, sip-4.17, PyQt-gpl-5.5.1, Qt5.5.1

Hi, trying to build PyQt on my system I did the following steps:

  1. download/install Qt5.5.1 libraries
  2. download/unpack SIP
  3. download/unpack PyQt
  4. install SIP:

    python3 configure.py -d /Library/Python/3.5/site-packages --arch x86_64
    
    make
    
    sudo make install
    
  5. tried to install PyQt:

    python3 configure.py -d /Library/Python/3.5/site-packages
                                   --qmake /.../Qt5.5.1/5.5/clang_64/bin/qmake
    

Configuration stopped with:

    /Users/werner/OpenSource/PyQt/sip/QtPositioning/qgeolocation.sip:28:10:
                             fatal >error: 'qgeolocation.h' file not found
     #include <qgeolocation.h>
               ^
      1 error generated.
      make[1]: *** [sipQtPositioningcmodule.o] Error 1
      make: *** [sub-QtPositioning-make_first-ordered] Error 2

I tried to finish installation doing

make
sudo make install

anyway. But the installation doesn't seem to be complete (e.g. uic, pyuic5 are missing). Here is what my installation directory looks like:

>ls /Library/Python/3.5/site-packages/PyQt5
QtBluetooth.so          QtSensors.so
QtCore.so               QtSerialPort.so
QtDBus.so               QtSql.so
QtDesigner.so           QtSvg.so
QtGui.so                QtTest.so
QtHelp.so               QtWebKit.so
QtMacExtras.so          QtWebKitWidgets.so
QtMultimedia.so         QtWidgets.so
QtMultimediaWidgets.so  QtXml.so
QtNetwork.so            QtXmlPatterns.so
QtOpenGL.so             _QOpenGLFunctions_2_0.so
QtPrintSupport.so       _QOpenGLFunctions_2_1.so
QtQml.so                _QOpenGLFunctions_4_1_Core.so
QtQuick.so

I couldn't find any useful information when searching for other discussions, so I hope someone can give me a hint on what I'm (maybe stupidly) doing wrong. Thank you for taking the time to read this.

5 个答案:

答案 0 :(得分:7)

如果您不需要此模块,更好的解决方法是在配置时禁用它。

python configure.py --disable=QtPositioning

答案 1 :(得分:6)

就在昨天,我也遇到了这样的问题。这就是我要解决的问题:

在/PyQt-gpl-5.5.1/QtPositioning中创建头文件qgeolocation.h,并将内容从alternation复制到其中。然后我成功进入sudo make和sudo make install。

虽然我不知道解决这个问题是否正确,但幸运的是,我安装了PyQt并输入了eric6。希望你也能成功。

答案 2 :(得分:0)

在OSX 10.11.1上为我添加location.h头文件。 我在PyQt-gpl-5.5.1和PyQt-gpl-5.5.2中都遇到了问题,但在添加之后 文件,能够建立。

答案 3 :(得分:0)

在/PyQt-gpl-5.5.1/QtPositioning中创建qgeolocation.h的方法对我有用。 QtPositioning.so已创建。

答案 4 :(得分:0)

您也可以从qt源文件夹中获取头文件(您已经将源文件与二进制文件一起安装了,对吗?),它位于:

TextBlock2.Text = row2

然后将其复制到:

/Src/qtlocation/src/positioning/qgeolocation.h

如下。它应该在99.9%的情况下解决问题。