man-group / dtale

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

NoneType object is not iterable #806

Closed dd1118 closed 1 year ago

dd1118 commented 1 year ago

I am trying to use dtale, and anytime I try to run the basic show or open_browser commands, I get TypeError: 'NoneType object is not iterable. This happens regardless of what data I am using the dataframe. I used the simple example from the github to rule out issues with my data.

import dtale import pandas as pd

df = pd.DataFrame([dict(a=1,b=2,c=3)])

d=dtale.show(df) d.open_browser()

image

aschonfeld commented 1 year ago

So I just ran this locally with no issue. My first question is, are you running these commands in a python console or jupyter notebook? Or are you trying to run this as a script?

If you're trying to run this as a script then you'll have to make some updates:

import dtale
import pandas as pd

if __name__ == '__main__':
    df = pd.DataFrame([dict(a=1,b=2,c=3)])
    dtale.show(df, subprocess=False, open_browser=True)
dd1118 commented 1 year ago

I have tried it both in jupyter notebook and spyder with the same issue in both.

aschonfeld commented 1 year ago

Ok can you try uninstalling dtale and reinstalling it? I've never seen this error before and it doesn't happen locally for me. Even if I pass None to dtale.show it will just start D-Tale with the upload menu displayed when you hit the URL

dd1118 commented 1 year ago

I reinstalled it and restarted and it is working now. Thanks

aschonfeld commented 1 year ago

Awesome! @dd1118 if you haven't already would you mind putting your ⭐ on this repo? Thanks 🙏