Giter Club home page Giter Club logo

Comments (10)

Asvel avatar Asvel commented on August 27, 2024

Is your PyQt5 working fine?

from pygs.

skrech avatar skrech commented on August 27, 2024

Yes, I'm trying to make global shortcuts for my PyQt5 application.

from pygs.

skrech avatar skrech commented on August 27, 2024

I've installed PyGlobalShortcut on python2 too, and the same error occurs.

from pygs.

ColinDuquesnoy avatar ColinDuquesnoy commented on August 27, 2024

Maybe the extension linked to the wrong qt library?

@skrech Could you paste the pip output?

@Asvel maybe we should change the build process so that it generates extension for both PyQt5 and PyQt4 (e.g. pygs4 and pygs5). That way it would be possible to have one app that use pygs + pyqt4 and another app that use pygs + pyqt5 on the same system. Currently this is impossible.

from pygs.

skrech avatar skrech commented on August 27, 2024

pip3 output:

$ sudo pip3 install PyGlobalShortcut
Downloading/unpacking PyGlobalShortcut
Downloading PyGlobalShortcut-0.2.3.zip (44kB): 44kB downloaded
Running setup.py (path:/tmp/pip_build_root/PyGlobalShortcut/setup.py) egg_info for package PyGlobalShortcut

Installing collected packages: PyGlobalShortcut
Running setup.py install for PyGlobalShortcut
building 'QxtGlobalShortcut' library
Project MESSAGE: This project is using private headers and will therefore be tied to this specific Qt module build version.
Project MESSAGE: Running this project against other versions of the Qt modules may crash at any arbitrary point.
Project MESSAGE: This is not a bug, but a result of using Qt internals. You have been warned!
g++ -c -m64 -pipe -O2 -fPIC -D_REENTRANT -Wall -W -DBUILD_QXT_CORE -DBUILD_QXT_GUI -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64 -I../../lib -I../../libqxt/src/core -I../../libqxt/src/widgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui/5.3.0 -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui/5.3.0/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. -I. -o qxtglobal.o ../../libqxt/src/core/qxtglobal.cpp
g++ -c -m64 -pipe -O2 -fPIC -D_REENTRANT -Wall -W -DBUILD_QXT_CORE -DBUILD_QXT_GUI -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64 -I../../lib -I../../libqxt/src/core -I../../libqxt/src/widgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui/5.3.0 -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui/5.3.0/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. -I. -o qxtglobalshortcut.o ../../libqxt/src/widgets/qxtglobalshortcut.cpp
g++ -c -m64 -pipe -O2 -fPIC -D_REENTRANT -Wall -W -DBUILD_QXT_CORE -DBUILD_QXT_GUI -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64 -I../../lib -I../../libqxt/src/core -I../../libqxt/src/widgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui/5.3.0 -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui/5.3.0/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. -I. -o qxtglobalshortcut_x11.o ../../libqxt/src/widgets/x11/qxtglobalshortcut_x11.cpp
/usr/lib/x86_64-linux-gnu/qt5/bin/moc -DBUILD_QXT_CORE -DBUILD_QXT_GUI -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64 -I/tmp/pip_build_root/PyGlobalShortcut/lib -I/tmp/pip_build_root/PyGlobalShortcut/libqxt/src/core -I/tmp/pip_build_root/PyGlobalShortcut/libqxt/src/widgets -I/usr/include/x86_64-linux-gnu/qt5/QtGui/5.3.0 -I/usr/include/x86_64-linux-gnu/qt5/QtGui/5.3.0/QtGui -I/usr/include/x86_64-linux-gnu/qt5 -I/usr/include/x86_64-linux-gnu/qt5/QtWidgets -I/usr/include/x86_64-linux-gnu/qt5/QtGui -I/usr/include/x86_64-linux-gnu/qt5/QtCore -I. -I/usr/include/c++/4.9 -I/usr/include/x86_64-linux-gnu/c++/4.9 -I/usr/include/c++/4.9/backward -I/usr/lib/gcc/x86_64-linux-gnu/4.9/include -I/usr/local/include -I/usr/lib/gcc/x86_64-linux-gnu/4.9/include-fixed -I/usr/include/x86_64-linux-gnu -I/usr/include ../../libqxt/src/widgets/qxtglobalshortcut.h -o moc_qxtglobalshortcut.cpp
g++ -c -m64 -pipe -O2 -fPIC -D_REENTRANT -Wall -W -DBUILD_QXT_CORE -DBUILD_QXT_GUI -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64 -I../../lib -I../../libqxt/src/core -I../../libqxt/src/widgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui/5.3.0 -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui/5.3.0/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. -I. -o moc_qxtglobalshortcut.o moc_qxtglobalshortcut.cpp
rm -f libQxtGlobalShortcut.a
ar cqs libQxtGlobalShortcut.a qxtglobal.o qxtglobalshortcut.o qxtglobalshortcut_x11.o moc_qxtglobalshortcut.o
building 'pygs' extension
g++ -c -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -O2 -Wall -W -D_REENTRANT -DNDEBUG -DQT_NO_DEBUG -DQT_CORE_LIB -DQT_GUI_LIB -I. -I/tmp/pip_build_root/PyGlobalShortcut/pygs/../libqxt/src/core -I/tmp/pip_build_root/PyGlobalShortcut/pygs/../libqxt/src/widgets -I/usr/include/python3.4m -I/usr/share/qt4/mkspecs/default -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I/usr/X11R6/include -o sippygscmodule.o sippygscmodule.cpp
g++ -c -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -O2 -Wall -W -D_REENTRANT -DNDEBUG -DQT_NO_DEBUG -DQT_CORE_LIB -DQT_GUI_LIB -I. -I/tmp/pip_build_root/PyGlobalShortcut/pygs/../libqxt/src/core -I/tmp/pip_build_root/PyGlobalShortcut/pygs/../libqxt/src/widgets -I/usr/include/python3.4m -I/usr/share/qt4/mkspecs/default -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I/usr/X11R6/include -o sippygsQxtGlobalShortcut.o sippygsQxtGlobalShortcut.cpp
g++ -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-O1 -shared -Wl,-O1 -Wl,--version-script=pygs.exp -o pygs.so sippygscmodule.o sippygsQxtGlobalShortcut.o -L/tmp/pip_build_root/PyGlobalShortcut/build/temp.linux-x86_64-3.4 -L/usr/lib -L/usr/X11R6/lib -lQxtGlobalShortcut -lQtCore -lQtGui

Successfully installed PyGlobalShortcut
Cleaning up...

from pygs.

ColinDuquesnoy avatar ColinDuquesnoy commented on August 27, 2024

Thanks. The issue is that the pyqt extension links with Qt4 while the qxtGlobalShortcut (c++) links with Qt5. To properly build pygs on systems that have both PyQt4 and PyQt5, you must set the QT_SELECT environment variable accordingly (as specified in the readme).

Could you try the following:

$ export QT_SELECT=5
$ sudo pip3 install PyGlobalShortcut

from pygs.

Asvel avatar Asvel commented on August 27, 2024

Add a check point to detect this situation.

@ColinDuquesnoy
I don't think add a version suffix like PyQt is a good idea (actually the version suffix of PyQt has troubled me many times), if someone need coexist various version of same lib, something like virtualenv could be used.

from pygs.

ColinDuquesnoy avatar ColinDuquesnoy commented on August 27, 2024

Hmm I think virtualenv are ok for developpers but for not for end user. It maybe a real pain to install PyQt in a virtualenv (copying the PyQt5 folder from sites-packages does not always work). End user are not always python developers and don't care about python specific solution. What about application distributed by a linux distribution? They won't install in a virtualenv...

Also if linux distributions provides support for both PyQt4 and PyQt5 I think we should do the same.

from pygs.

Asvel avatar Asvel commented on August 27, 2024

You are right, let's figure out how to support coexisting.

from pygs.

ColinDuquesnoy avatar ColinDuquesnoy commented on August 27, 2024

I would add a suffix. pygs4 would mean that it is built to work with PyQt4 (which can be linked to Qt4 or Qt5) and pygs5 would mean that it is built to work with PyQt5. Nothing prevents you from writing a pygs wrapper module that conditionally import the proper module and expose a unified API. If you do that, don't forget to give the user a way to choose the desired API (e.g. using an environment variable).

You probably just have to rework your build functions a bit in setup.py. Try each API, skip the one that are not available and built each candidate separately. The good thing is that you already link statically with libQxt so there is no need to add a suffix to libQxt ;)

from pygs.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.