pandasgui allows commercial use under the MIT license but I noticed the library used includes PYQT5 which is under the GPL v3 licence how is that possible ?
PyQt5 is dual-licensed under the GPLv3 and under a proprietary commercial license. With dual-licensed software, you as a user get to choose which license conditions you want to follow.
So, you can choose to use PyQt5 at no charge under the GPLv3 conditions, or you can choose to buy a commercial license that allows you to create closed-source products using PyQt5.
pandasgui has decided not to make the choice for you which PyQt5 license to use, but to license the pandasgui code in a way that is compatible with both license choices for PyQt5.
The critique I have on pandasgui is that they could have mentioned this dependency on a (potentially) GPL-licensed package more clearly in their documentation.