hfaran / slack-export-viewer

A Slack Export archive viewer that allows you to easily view and share your Slack team's export
https://pypi.python.org/pypi/slack-export-viewer
MIT License
908 stars 192 forks source link

FileNotFoundError: [Errno 2] No such file or directory: #111

Open odelamp opened 4 years ago

odelamp commented 4 years ago

Hiya, I'm unable to get to work, seeing the following: slack-export-viewer -z ./Test.zip /var/folders/gk/bfc6585n3978hhfg5csf21nh0000gq/T/_slackviewer/75b85b8b74ebd38130549f260a1164a277385a61 already exists Traceback (most recent call last): File "/usr/local/bin/slack-export-viewer", line 10, in sys.exit(main()) File "/usr/local/lib/python2.7/site-packages/click/core.py", line 764, in call return self.main(args, kwargs) File "/usr/local/lib/python2.7/site-packages/click/core.py", line 717, in main rv = self.invoke(ctx) File "/usr/local/lib/python2.7/site-packages/click/core.py", line 956, in invoke return ctx.invoke(self.callback, ctx.params) File "/usr/local/lib/python2.7/site-packages/click/core.py", line 555, in invoke return callback(args, **kwargs) File "/usr/local/lib/python2.7/site-packages/slackviewer/main.py", line 61, in main configure_app(app, archive, channels, no_sidebar, no_external_references, debug) File "/usr/local/lib/python2.7/site-packages/slackviewer/main.py", line 21, in configure_app reader = Reader(path) File "/usr/local/lib/python2.7/site-packages/slackviewer/reader.py", line 21, in init with io.open(os.path.join(self._PATH, "users.json"), encoding="utf8") as f: IOError: [Errno 2] No such file or directory: '/var/folders/gk/bfc6585n3978hhfg5csf21nh0000gq/T/_slackviewer/75b85b8b74ebd38130549f260a1164a277385a61/users.json'

MiraiHattori commented 4 years ago

Please extract Test.zip in your local environment and confirm whether users.json exists or not. It would be helpful if you could check /var/folders/gk/bfc6585n3978hhfg5csf21nh0000gq/T/_slackviewer/75b85b8b74ebd38130549f260a1164a277385a61/users.json

supermitch commented 4 years ago

@odelamp make sure you don't zip the folder containing your channels, but only the channels & files themselves, i.e. the channels and JSON files users.json, channels.json, etc, should be at the root of your .zip archive.

Shuning-Zhang commented 3 years ago

@supermitch I did what you said, but when I was opening the channels.json.zip it still shows the same thing as it was showed up there? what did I do wrong?

hdsheena commented 3 years ago

I'm having this same issue, I have checked the tmp folder does contain users.json but I see this error regardless :(

hdsheena commented 3 years ago

My zip was at the wrong level. I had a zip of the containing folder. When I zipped just the contents, problem went away :)

jowebb commented 1 year ago

Hello - I have a similar issue but in my case the tmp folder doesn't contain anything. So the error message is legit, I just don't know what to try next. The zip has users.json etc. at the root unless I'm missing something.

From the Cygwin64 terminal: $ slack-export-viewer -z slackexport.zip /tmp/_slackviewer/fd2c7fb58f5761cbdf6086edb4b401198a500a10 already exists Traceback (most recent call last): File "/usr/bin/slack-export-viewer", line 33, in sys.exit(load_entry_point('slack-export-viewer==1.1.4', 'console_scripts', 'slack-export-viewer')()) File "/usr/lib/python3.6/site-packages/click/core.py", line 1128, in call return self.main(args, kwargs) File "/usr/lib/python3.6/site-packages/click/core.py", line 1053, in main rv = self.invoke(ctx) File "/usr/lib/python3.6/site-packages/click/core.py", line 1395, in invoke return ctx.invoke(self.callback, ctx.params) File "/usr/lib/python3.6/site-packages/click/core.py", line 754, in invoke return __callback(args, **kwargs) File "/usr/lib/python3.6/site-packages/slackviewer/main.py", line 61, in main configure_app(app, archive, channels, no_sidebar, no_external_references, debug) File "/usr/lib/python3.6/site-packages/slackviewer/main.py", line 21, in configure_app reader = Reader(path) File "/usr/lib/python3.6/site-packages/slackviewer/reader.py", line 21, in init with io.open(os.path.join(self._PATH, "users.json"), encoding="utf8") as f: FileNotFoundError: [Errno 2] No such file or directory: '/tmp/_slackviewer/fd2c7fb58f5761cbdf6086edb4b401198a500a10/users.json'

zip contents:

Screen Shot 2022-08-11 at 11 14 30 AM

tmp dir;

Screen Shot 2022-08-11 at 11 24 09 AM

I would really appreciate some help with this.

jowebb commented 1 year ago

Figured out my own problem... no idea what was up with the original zip - but simply recreating it (with exactly the same content as before) worked (other than images not rendering and nothing for videos but separate issues). Nice solution overall though - thanks!

natea commented 10 months ago

I'm seeing the same issue. It can't find the users.json file, and I just used the normal Slack export command available in the Slack admin screen.

FileNotFoundError: [Errno 2] No such file or directory: '/Users/nateaune/Downloads/SlackExport/users.json'