Chats not loading properly
lawrencedy1 opened this issue · 1 comments
Hi! I've been trying to import my own chats into the program using the Jupyter notebook but it no longer works anymore.
It throws up an error in the Load your Chats section:
NotADirectoryError Traceback (most recent call last)
in
----> 1 cs = chatstat.ChatStat(*loader.parse_from_json('/Users/lawrence/Desktop/inbox'))
~/Facebook-Messenger-Statistics/loader.py in parse_from_json(path)
39 raise NotADirectoryError("{path} is not a directory")
40 messages_dir = [path / mdir for mdir in os.listdir(path)]
---> 41 all_files = [msg_dir / json_file for msg_dir in messages_dir for json_file in os.listdir(msg_dir) if json_file.startswith(JSON_FILENAME)]
42
43 chat_data = []
~/Facebook-Messenger-Statistics/loader.py in (.0)
39 raise NotADirectoryError("{path} is not a directory")
40 messages_dir = [path / mdir for mdir in os.listdir(path)]
---> 41 all_files = [msg_dir / json_file for msg_dir in messages_dir for json_file in os.listdir(msg_dir) if json_file.startswith(JSON_FILENAME)]
42
43 chat_data = []
NotADirectoryError: [Errno 20] Not a directory: '/Users/lawrence/Desktop/inbox/.DS_Store'
It appears that a .DS_Store hidden file (Mac OS X system file for folders, cannot be deleted) is interfering and causing the folder not to be classed as a directory. I've tried with an empty folder that appears not to have the file and the code works, but it looks like the system file is created soon after any folder is transferred inside it.
Is there any workaround for this?
Never mind, found a workaround.
Delete the .DS_Store file in Terminal using:
cd [path of folder]
find . -name ".DS_Store" -delete
Then run the Jupyter program seems to work. I think this needs to be done frequently (so would be nice if there's a permanent fix). Thanks for the nice program btw!