man-group / dtale

Visualizer for pandas data structures
http://alphatechadmin.pythonanywhere.com
GNU Lesser General Public License v2.1
4.72k stars 400 forks source link

If you use Dtale and Pandas Profiling in the same notebook you need to reinstall pyyaml again #598

Closed jackesselink closed 2 years ago

jackesselink commented 2 years ago

If you install the package Pandas Profiling package this upgrades the pyyaml file to a higher version which makes Dtale crash. To makes Dtale run again pyyaml version 5.4.1 needs to be reinstalled

!pip install pyyaml==5.4.1

aschonfeld commented 2 years ago

Any chance you can give me some more information on your environment? D-Tale has no dependency on pyyaml and from what I can tell pandas profiling doesn't either. Do you have an exception message you're seeing? Thanks

P.S. I was able to install pandas profiling in my local environment and D-Tale was still able to function as expected (using python 3.8). I wonder if it has more to do with jupyter notebooks than D-Tale.

jackesselink commented 2 years ago

My environment is Google Colabs. I have a Jupyter notebook which I use for teaching EDA. I installed Dtale after Pandas Profiling and it failed to import. After doing a Google search I found this error and fix. I did reinstall this YAML file and it worked again. I'll send you a link to the Colab notebook via email

jackesselink commented 2 years ago

If you can follow me back on Twitter @esselinj you can DM me your email address

aschonfeld commented 2 years ago

@jackesselink so I've finally gotten around to digging into this. Looks like this is mainly a Google Colab issue. By instally Pandas Profiling it updates the version of pyyaml which is not compatible with the way that Google Colab imports packages.

So the issue is that the first thing you imported import dtale was the first thing to trigger Google Colab's package importing which in turn threw the error. So if you imported anything the same error would have been thrown. Ultimately, I think your solution to downgrade pyyaml is the only way to go. Apologies this wasn't more of a silver bullet, but I'd just include !pip install pyyaml==5.4.1 in your script after installing Pandas Profiling.

Lastly, if you haven't done so already, would you mind tossing your ⭐ on D-Tale's repo? Thanks 🙏

jackesselink commented 2 years ago

Thanks @aschonfeld for the headsup. Hopefully this will help anyone running into the same problem in Colab.