Closed ioanpier closed 3 years ago
Could you share a Google Colab notebook that produces this error? I'm surprised you even got past the PyQt imports, usually those fail on Google Colab because it has no GUI backend - I'd expect PandasGUI to not work at all on Colab.
Regarding the specific error message you have though, that line has been removed in recent commits so if you run pip install git+https://github.com/adamerose/pandasgui.git
that should fix it
https://colab.research.google.com/drive/1IKUGk7KOyEChJ6pb_CdDMaqKIzkYGo24?usp=sharing
After installing the library again from the github link, I'm getting a new error ImportError: cannot import name 'Literal' from 'typing' (/usr/lib/python3.7/typing.py)
. If pandasgui cannot work on Colab, there should preferably an appropriate warning when trying to import it, otherwise perhaps mentioned in the installation guide.
Full stacktrace
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-c5c5d8976c89> in <module>()
1 import pandas as pd
----> 2 from pandasgui import show
3 df = pd.DataFrame(([[1, 2, 3], [4, 5, 6], [7, 8, 9]]), columns=['a', 'b', 'c'])
4 show(df)
3 frames
/usr/local/lib/python3.7/dist-packages/pandasgui/__init__.py in <module>()
13
14 # Imports
---> 15 from pandasgui.gui import show
16
17 __all__ = ["show", "__version__"]
/usr/local/lib/python3.7/dist-packages/pandasgui/gui.py in <module>()
13 from pandasgui.store import PandasGuiStore, PandasGuiDataFrameStore
14 from pandasgui.utility import fix_ipython, fix_pyqt, as_dict, delete_datasets, resize_widget, get_figure_type
---> 15 from pandasgui.widgets.dataframe_explorer import DataFrameExplorer
16 from pandasgui.widgets.grapher import schemas
17 from pandasgui.widgets.func_ui import BooleanArg
/usr/local/lib/python3.7/dist-packages/pandasgui/widgets/dataframe_explorer.py in <module>()
6
7 from pandasgui.utility import nunique
----> 8 from pandasgui.widgets.dataframe_viewer import DataFrameViewer
9 from pandasgui.widgets.grapher import Grapher
10 from pandasgui.widgets.reshaper import Reshaper
/usr/local/lib/python3.7/dist-packages/pandasgui/widgets/dataframe_viewer.py in <module>()
7 from PyQt5 import QtCore, QtGui, QtWidgets
8 from PyQt5.QtCore import Qt
----> 9 from typing import Literal
10 from pandasgui.store import PandasGuiStore, PandasGuiDataFrameStore
11 import pandasgui
ImportError: cannot import name 'Literal' from 'typing' (/usr/lib/python3.7/typing.py)
---------------------------------------------------------------------------
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.
To view examples of installing some common dependencies, click the
"Open Examples" button below.
---------------------------------
Most of these errors were actually related to some broken backwards compatibility with Python 3.7 not Colab specifically. I think I've fixed those all now, but like I said Colab is unsupported because it can't run PyQt5. If you install the latest dev version of PandasGUI you will see an error like below
WARNING | Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb.
WARNING | This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
If pandasgui cannot work on Colab, there should preferably an appropriate warning when trying to import it, otherwise perhaps mentioned in the installation guide.
Yeah the docs are still pretty incomplete, once I work on them I'll add a note about supported platforms.
Describe the bug
When I try to run the example code on a Jupyter Notebook:
Full stack trace of the error
Environment OS: Unknown Python: eg. 3.7.10 IDE: Google Colab
Package versions
TO GET ALL RELEVANT PACKAGE VERSIONS, RUN THIS COMMAND IN BASH AND PASTE THE OUTPUT pip freeze | grep -i "pyqt|pandasgui|plotly|ipython|jupyter|notebook"
EXAMPLE OUTPUT