RuntimeError: the sip module implements API v8.0 to v8.1 but the PyQt4.QtCore module requires API v7.1

天涯浪子 提交于 2019-12-06 04:29:25

Firstly, installing things in /tmp is not a good idea, because it is intended only for temporary files (most systems will be set up to remove everything in /tmp during the boot or shutdown process).

Secondly, you should NEVER attempt to modify your system python or any of its packages - this will almost certainly lead to breakage of other applications that depend on python. If you need a different version of python and/or its packages, create a completely separate installation under /usr/local.

With that in place, you just need to ensure that your new python is specified whenever you are compiling packages for it.

So, to compile Sip you would do:

/usr/local/bin/python sip_source/configure.py

And for PyQt4, you would do the same - but also add a couple of other options that should avoid over-writing system files:

/usr/local/bin/python pyqt4_source/configure.py \
--qsci-api-destdir /usr/local/lib/qt4/qsci --no-designer-plugin

Once this has been set up, you can then create a simple wrapper script for running applications that need the upgraded python:

#!/bin/sh
exec /usr/local/bin/python myapp.py "$@"

Note that you do not need to change $PYTHONPATH for any of this to work, and so you should undo any changes you have made to it. (And you might also want to consider re-installing your fedora sip and pyqt packages to ensure everything is put back the way it was).

As for the errors regarding Phonon, the solution is simple: if the header files are missing, install the fedora package that contains them.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!