Issues with loading Pandagui

552 Views Asked by At

I'm trying to load PandasGUI after installing it (on a mac) with the following lines

%pip install pandasgui
from pandasgui import show

But it is showing the following error

`---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Input In [1], in <cell line: 2>()
  1 from pandas_profiling import ProfileReport
----> 2 from pandasgui import show

File /opt/anaconda3/lib/python3.9/site-packages/pandasgui/__init__.py:15, in <module>
     12 logger.addHandler(sh)
     14 # Imports
---> 15 from pandasgui.gui import show
     17 __all__ = ["show", "__version__"]

File /opt/anaconda3/lib/python3.9/site-packages/pandasgui/gui.py:13, in <module>
     10 from PyQt5.QtCore import Qt
     12 import pandasgui
---> 13 from pandasgui.constants import PANDASGUI_ICON_PATH
     14 from pandasgui.store import PandasGuiStore, SettingsSchema
     15 from pandasgui.utility import as_dict, fix_ipython, get_figure_type, resize_widget

File /opt/anaconda3/lib/python3.9/site-packages/pandasgui/constants.py:15, in <module>
     12 PANDASGUI_ICON_PATH = pkg_resources.resource_filename(__name__,     "resources/images/icon.png")
     13 PANDASGUI_ICON_PATH_ICO = pkg_resources.resource_filename(__name__, "resources/images/icon.ico")
---> 15 SHORTCUT_PATH = os.path.join(os.getenv('APPDATA'), 'Microsoft/Windows/Start     Menu/Programs/PandasGUI.lnk', )
     16 PY_INTERPRETTER_PATH = os.path.join(os.path.dirname(sys.executable), 'python.exe')
     17 PYW_INTERPRETTER_PATH = os.path.join(os.path.dirname(sys.executable), 'pythonw.exe')

File /opt/anaconda3/lib/python3.9/posixpath.py:76, in join(a, *p)
     71 def join(a, *p):
     72     """Join two or more pathname components, inserting '/' as needed.
     73     If any component is an absolute path, all previous path components
     74     will be discarded.  An empty last part will result in a path that
     75     ends with a separator."""
---> 76     a = os.fspath(a)
     77     sep = _get_sep(a)
     78     path = a

TypeError: expected str, bytes or os.PathLike object, not NoneType`

I've tried rerunning the code, restarting...etc

1

There are 1 best solutions below

0
On

Had the same issue on my mac. A quick fix is to edit the constants.py file (/opt/anaconda3/lib/python3.9/site-packages/pandasgui/constants.py).

Just replace the line SHORTCUT_PATH = os.path.join(os.getenv('APPDATA'), 'Microsoft/Windows/Start Menu/Programs/PandasGUI.lnk', )

with the following:

if sys.platform == 'win32':
    SHORTCUT_PATH = os.path.join(os.getenv('APPDATA'), 'Microsoft/Windows/Start Menu/Programs/PandasGUI.lnk')
else:
    SHORTCUT_PATH = None