PandasGUI icon indicating copy to clipboard operation
PandasGUI copied to clipboard

Variable Dragging not working on osx

Open robdmc opened this issue 4 years ago • 20 comments

I love this project. I can see myself using it constantly. It really fits a niche of working between spreadsheet and notebook. I actually think you could charge for this when it's mature.

Running miniconda python on OSX Cataline, and when trying to plot, the variables won't drag over. Let me know the best way to communicate my system state, and I can give you what you need.

Here's my setup.

λ which python
/Users/rob/miniconda/envs/viz/bin/python
•_simbiz•[mac_pro][19:17:04]( master )[ ~/rob/repos/sales_ops ]
λ python --version
Python 3.6.8 :: Anaconda, Inc.
•_simbiz•[mac_pro][19:17:08]( master )[ ~/rob/repos/sales_ops ]
λ pip freeze | grep gui
pandasgui==0.2.4.3
λ pip freeze | grep -i pyqt
PyQt5==5.15.1
PyQt5-sip==12.8.1
PyQtWebEngine==5.15.1

robdmc avatar Oct 15 '20 23:10 robdmc

The same problems and annoyances.

zkung avatar Oct 18 '20 03:10 zkung

Can't reproduce the issue on Windows 10, so need someone else to help fix this and submit a PR.

Does this minimal example work? That'll help narrow down where the problem is

import sys
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtCore import Qt

app = QtWidgets.QApplication(sys.argv)

list1 = QtWidgets.QListWidget()
list2 = QtWidgets.QListWidget()

list1.addItems(['1a','1b','1c'])
list2.addItems(['2a','2b','2c'])

list1.setDragEnabled(True)
list2.setDragEnabled(True)
list1.setAcceptDrops(True)
list2.setAcceptDrops(True)

container = QtWidgets.QWidget()
layout = QtWidgets.QVBoxLayout()
layout.addWidget(list1)
layout.addWidget(list2)
container.setLayout(layout)
container.show()

app.exec_()

adamerose avatar Oct 18 '20 04:10 adamerose

import sys
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtCore import Qt

app = QtWidgets.QApplication(sys.argv)

list1 = QtWidgets.QListWidget()
list2 = QtWidgets.QListWidget()

list1.addItems(['1a','1b','1c'])
list2.addItems(['2a','2b','2c'])

list1.setDragEnabled(True)
list2.setDragEnabled(True)
list1.setAcceptDrops(True)
list2.setAcceptDrops(True)

container = QtWidgets.QWidget()
layout = QtWidgets.QVBoxLayout()
layout.addWidget(list1)
layout.addWidget(list2)
container.setLayout(layout)
container.show()

app.exec_()

This dragging works perfectly on OSX.

zkung avatar Oct 18 '20 12:10 zkung

Thank, the pandasGUI dragging functionality is already available.

zkung avatar Oct 18 '20 12:10 zkung

I also think this is an awesome project!

I can confirm the dragging functionality does not work on macOS.

MacOS Catalina ver 10.15.7

I tried the example above just in a python console from the terminal and it's the same effect. It creates the gui window with the 2 lists, none of the items in the list are "grab-able".

Wish I could help contribute but I think this is out of my area of experience.

RyanMannix avatar Oct 20 '20 20:10 RyanMannix

@adamerose The toy example you provided (copied below) works fine on my copy of osx cataline

import sys
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtCore import Qt

app = QtWidgets.QApplication(sys.argv)

list1 = QtWidgets.QListWidget()
list2 = QtWidgets.QListWidget()

list1.addItems(['1a','1b','1c'])
list2.addItems(['2a','2b','2c'])

list1.setDragEnabled(True)
list2.setDragEnabled(True)
list1.setAcceptDrops(True)
list2.setAcceptDrops(True)

container = QtWidgets.QWidget()
layout = QtWidgets.QVBoxLayout()
layout.addWidget(list1)
layout.addWidget(list2)
container.setLayout(layout)
container.show()

app.exec_()

robdmc avatar Oct 21 '20 14:10 robdmc

@adamerose I just updated to version pandasgui==0.2.5.1, and drag and drop appears to be working now. Thanks for the quick turn around. This issue can be closed as far as I'm concerned.

And thanks again for writing this.

robdmc avatar Oct 21 '20 14:10 robdmc

I just updated to version pandasgui==0.2.5.1, and drag and drop appears to be working now

None of those changes were related to this issue 😅 Maybe it randomly works sometimes? I'd be surprised if any of my recent commits fixed it

And apparently my toy demo posted above worked for @robdmc but didn't work for @RyanMannix ?

adamerose avatar Oct 21 '20 16:10 adamerose

I updated my pandasGUI, dragging function to use normal, thank you.

zkung avatar Oct 21 '20 20:10 zkung

For me, none of the dragdrop is working. even the example above not working on MACOS - Mojave

using pandasgui==0.2.5.1

rajgupt avatar Oct 22 '20 06:10 rajgupt

I'm also using this project on MacOS Catalina 10.15.7, and yesterday everything worked fine. However, today I have this issue, I cannot drag variables to the axis of the graph to generate a graph.

MiguelCosme avatar Oct 22 '20 08:10 MiguelCosme

If it's at all helpful sorting this out, here are the exact versions that are working for me. on Catalina

Python 3.6.8 :: Anaconda, Inc.

pandasgui==0.2.5.1
PyQt5==5.15.1
PyQt5-sip==12.8.1
PyQtWebEngine==5.15.1

robdmc avatar Oct 22 '20 13:10 robdmc

On Tuesday I had upgraded just before I made my comment, so I'm not 100% sure which version but whatever was most current at that time.

Regardless, I started a new virtual env, installed a few of the libraries I need for my project, then installed pandasgui and it works fine. So 👍 . Not sure if it's an updated version available through pypi since Tuesday, or if maybe not having cv2 full version installed prior to installing pandasgui just the headless versiono, or something else in my pip list was causing the issue.

As a side note, I had issues with PyQt5 (I do not remember the exact error)- I was importing cv2 and pandasgui which are both trying to use it, so originally I had uninstalled cv2 and installed the headless version. That appeared to solve the issue with PyQt5/using cv2 and pandasgui at the same time.

MacOS version: Catalina 10.15.7 opencv-python-headless==4.4.0.44 pandasgui==0.2.5.1 PyQt5==5.15.1 PyQt5-sip==12.8.1 PyQtWebEngine==5.15.1

RyanMannix avatar Oct 22 '20 22:10 RyanMannix

FWIW. I just checked. I have opencv installed as well. Didn't know there could be an interaction there, as I almost never use it.

opencv-python==4.2.0.32

robdmc avatar Oct 23 '20 14:10 robdmc

I don't think the PyQt5 issues I had were related to pandasgui specifically. I think that only one library can be using it at the same time. If I understand it correctly, PyQt5 is what is bringing up the additional window, and, at least on macs, you can't have 2 libraries imported at the same time that both use PyQt5 for this feature. And having them installed is fine as long as you don't import them.

I did a quick test in a new env, and indeed importing both libraries causes the following error:

objc[50195]: Class QMacAutoReleasePoolTracker is implemented in both /path/to/env/env/lib/python3.7/site-packages/cv2/.dylibs/QtCore (0x11332b700) and /path/to/env/env/lib/python3.7/site-packages/PyQt5/Qt/lib/QtCore.framework/Versions/5/QtCore (0x12b951178). One of the two will be used. Which one is undefined.
objc[50195]: Class QT_ROOT_LEVEL_POOL__THESE_OBJECTS_WILL_BE_RELEASED_WHEN_QAPP_GOES_OUT_OF_SCOPE is implemented in both /path/to/env/env/lib/python3.7/site-packages/cv2/.dylibs/QtCore (0x11332b778) and /path/to/env/env/lib/python3.7/site-packages/PyQt5/Qt/lib/QtCore.framework/Versions/5/QtCore (0x12b9511f0). One of the two will be used. Which one is undefined.
objc[50195]: Class KeyValueObserver is implemented in both /path/to/env/env/lib/python3.7/site-packages/cv2/.dylibs/QtCore (0x11332b7a0) and /path/to/env/env/lib/python3.7/site-packages/PyQt5/Qt/lib/QtCore.framework/Versions/5/QtCore (0x12b951218). One of the two will be used. Which one is undefined.
objc[50195]: Class RunLoopModeTracker is implemented in both /path/to/env/env/lib/python3.7/site-packages/cv2/.dylibs/QtCore (0x11332b7f0) and /path/to/env/env/lib/python3.7/site-packages/PyQt5/Qt/lib/QtCore.framework/Versions/5/QtCore (0x12b951268). One of the two will be used. Which one is undefined.

RyanMannix avatar Oct 23 '20 15:10 RyanMannix

I have the same issue in macOS Catalina using python in Anaconda. According to the first answer in this link, the issue is caused by conflicts among the related modules installed from different channels.

If you are working within an Anaconda environment in a macOS as well, then the following steps might help.

  • Open a terminal and run conda list | greq pyqt. If you see something similar to

    pyqt                      5.9.2            py37h655552a_2  
    pyqt5                     5.15.1                   pypi_0    pypi
    pyqt5-sip                 12.8.1                   pypi_0    pypi
    pyqtwebengine             5.15.1                   pypi_0    pypi
    

    then continue to the next step.

  • Uninstall the three packages managed by pypi above. Do NOT uninstall pyqt.

    pip uninstall pyqt5 pyqt5-sip pyqtwebengine
    
  • If you run the toy example above at this moment, it should work (drag and drop). But pandasgui still needs the modules we uninstalled just now.

  • I updated pyqt here using conda update pyqt. But I am not sure whether this operation is really necessary.

  • Finally and magically, reinstall the deleted packages using pip solve this issue:

    pip install pyqt5-sip pyqtwebengine
    

    (pyqt5 will be automatically installed as pyqtwebengine depends on it).

uiharu-kazari avatar Oct 26 '20 05:10 uiharu-kazari

I have same issue, toy example also didn't work for me. I used jupyter with osX catalina.

pandasgui version 0.2.7

uninstall and re-install of pyqt5 (above comment) didn't work.

jhk0530 avatar Oct 26 '20 09:10 jhk0530

I just updated to version pandasgui==0.2.5.1, and drag and drop appears to be working now

None of those changes were related to this issue 😅 Maybe it randomly works sometimes? I'd be surprised if any of my recent commits fixed it

And apparently my toy demo posted above worked for @robdmc but didn't work for @RyanMannix ?

I can confirm that as weird as it sounds it actually seems to be working randomly. It was working me on day 1 (after multiple tries) when I used it and ever since then stopped working.

In reality, of course it is not random, there must be a hidden variable that is at play that needs to be addressed for the time being though I have no clue what that may be....

shanto268 avatar Oct 29 '20 18:10 shanto268

I have the same issue in macOS Catalina using python in Anaconda. According to the first answer in this link, the issue is caused by conflicts among the related modules installed from different channels.

If you are working within an Anaconda environment in a macOS as well, then the following steps might help.

  • Open a terminal and run conda list | greq pyqt. If you see something similar to

    pyqt                      5.9.2            py37h655552a_2  
    pyqt5                     5.15.1                   pypi_0    pypi
    pyqt5-sip                 12.8.1                   pypi_0    pypi
    pyqtwebengine             5.15.1                   pypi_0    pypi
    

    then continue to the next step.

  • Uninstall the three packages managed by pypi above. Do NOT uninstall pyqt.

    pip uninstall pyqt5 pyqt5-sip pyqtwebengine
    
  • If you run the toy example above at this moment, it should work (drag and drop). But pandasgui still needs the modules we uninstalled just now.

  • I updated pyqt here using conda update pyqt. But I am not sure whether this operation is really necessary.

  • Finally and magically, reinstall the deleted packages using pip solve this issue:

    pip install pyqt5-sip pyqtwebengine
    

    (pyqt5 will be automatically installed as pyqtwebengine depends on it).

I can confirm that on macOS Catalina version 10.15.7 that this fix did not work. Dragging still not working after uninstalling/reinstalling

ragyabraham avatar Nov 01 '20 02:11 ragyabraham

I had same issue.
But after I drag dataframe in left pane, I am able to drag variables.

happyware avatar Nov 26 '20 19:11 happyware