Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No main.py created in windows?? #77

Open
slormo opened this issue Oct 27, 2022 · 7 comments
Open

No main.py created in windows?? #77

slormo opened this issue Oct 27, 2022 · 7 comments

Comments

@slormo
Copy link

slormo commented Oct 27, 2022

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?

@kensanata
Copy link
Owner

Sadly, I have no idea and never tried to install it on a Windows machine. Anybody else?

@IzzySoft
Copy link
Contributor

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.

@IzzySoft
Copy link
Contributor

IzzySoft commented Nov 1, 2022

@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 😉

@slormo
Copy link
Author

slormo commented Nov 2, 2022

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.
Screenshot 2022-11-02 234211

@IzzySoft
Copy link
Contributor

IzzySoft commented Nov 3, 2022

Yes, mastodon-archive.py must be one level up: next to the mastodon-archive directory, not inside.

@slormo
Copy link
Author

slormo commented Nov 3, 2022

I've moved it to the correct location, but it still throws up the exact same error.

@IzzySoft
Copy link
Contributor

IzzySoft commented Nov 3, 2022

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants