mastodon-archive
mastodon-archive copied to clipboard
No main.py created in windows??
After installing the repo as instructed, I ran the command to test it.
C:\Users\****>python3 mastodon-archive archive [email protected]
This returned the error:
C:\Users\****\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\python.exe: can't find '__main__' module in 'C:\\Users\\****\\mastodon-archive'
It looks like a main.py file was not created. Any help?
Sadly, I have no idea and never tried to install it on a Windows machine. Anybody else?
Maybe we should include the one created by contrib/debinstall.sh
as a file for such cases, so users can simply copy it over manually (would also make packaging easier and the SPEC file for that cleaner)? All windows I have are just for light and fresh air, and the prefixed "MasterShutter" ("MS for my Windows") is a Somfy remote control, so I cannot test there either.
@slormo can you pick the contrib/mastodon-archive.py
from the linked PR, place that into the mastodon-archive/
directory and see if that works for you?
PS: Keep the file name as-is; Python is not looking for a main.py
file but for the "procedure". If you look into the file you'll see what I mean:
#!/usr/bin/env python3
import mastodon_archive
if __name__ == "__main__":
mastodon_archive.main()
The main()
called from there you can find in mastodon_archive/__init__.py
as def main
. So this wrapper script basically just tells Python where to look :wink:
Nope, still doesn't work I'm afraid.
I tried the command, and got this error still.
C:\Users\****>python3 mastodon-archive archive --no-favourites --no-bookmarks [email protected]
C:\Users\****\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\python.exe: can't find '__main__' module in 'C:\\Users\\****\\mastodon-archive'
Here's my directory, in case I've done anything wrong.
Yes, mastodon-archive.py
must be one level up: next to the mastodon-archive
directory, not inside.
I've moved it to the correct location, but it still throws up the exact same error.
Did you call it with
python3 mastodon-archive.py archive --no-favourites --no-bookmarks <account>
i.e. include the .py
so Python knows to use the file and not the directory directly?