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

Could you release a windows executable that includes Python? #42

Open
stroop566 opened this issue Feb 23, 2019 · 9 comments
Open

Could you release a windows executable that includes Python? #42

stroop566 opened this issue Feb 23, 2019 · 9 comments

Comments

@stroop566
Copy link

use PyInstaller or py2exe, just like youtube-dl.
so I can use it in cmd:

$ mastodon-archive.exe text [email protected] > statuses.txt
$ mastodon-archive html [email protected]

References:

  1. https://medium.com/dreamcatcher-its-blog/making-an-stand-alone-executable-from-a-python-script-using-pyinstaller-d1df9170e263
  2. https://stackoverflow.com/questions/5458048/how-to-make-a-python-script-standalone-executable-to-run-without-any-dependency
    thank you!
@kensanata
Copy link
Owner

kensanata commented Feb 23, 2019 via email

@stroop566
Copy link
Author

stroop566 commented Feb 23, 2019

sorry,my coding ability is poor.
but you can try vmware or virtualbox.

What you can do is run Virtualbox or similar application to run the OS virtually and, create executable in that virtual os and export it later. Also, Wine works as well! (Though, I didn’t try it myself)

thank you much more.

@BartG95
Copy link
Contributor

BartG95 commented Feb 23, 2019

I can probably help out. I currently have a windows machine. It will only allow me start this project, because I plan switch to a non-windows system soon-ish. So after that, someone has to maintain it. Maintenance shouldn't be very difficult for a non-coder. I can probably set up a manual.

@kensanata
Copy link
Owner

kensanata commented Feb 23, 2019 via email

@stroop566
Copy link
Author

thanks all :)

@BartG95
Copy link
Contributor

BartG95 commented Feb 23, 2019

After two hours of trying, this is my conclusion:

  • pyinstaller doesn't work: it can not find the main module, therefore doesn't include it in the final .exe.
  • py2exe (used by youtube-dl) only works on python 3.4. I have python 3.7 installed. I could of course install 3.4 side-by-side, but p2exe isn't updated in the last 5 years and I don't see why I would install such old software.

I will probably try again in about a few days, but as for now, I wasted to many hours on this.
Sorry ;)
Have a nice weekend.

@kensanata
Copy link
Owner

kensanata commented Feb 23, 2019 via email

@BartG95
Copy link
Contributor

BartG95 commented Feb 28, 2019

@stroop566 If you want to try it yourself, here is a short guide:

  • Install Python 3.4 on your system and make sure it is the only python3 version you have installed (e.g. remove other python3 installations such as Python3.7).
  • Make a clone of this repository; or if you don't know how to do that: just download the zip: https://github.com/kensanata/mastodon-backup/archive/master.zip
  • Start a command prompt or a powershell window as administrator.
  • Make sure you are in the downloaded folder.
  • (In Windows 10 you can easily open a cmd/powershell in the current folder by using the file menu on the ribbon of the explorer.)
  • Within the downloaded folder, run pip install -e . (don't forget the dot at the end).
  • (At this point you should be able to use mastodon-archive yourself.)
  • Type pip install py2exe.
  • Run py2exe; this should create a standalone .exe you can give to your friends or use yourself.

I haven't tested the last two points of this procedure myself; feel free to let me know if it does (not) work.

@stroop566
Copy link
Author

stroop566 commented Mar 2, 2019

@BartG95 thank you! but get some errors.

D:\mastodon-backup\master\mastodon-backup-master>python --version
Python 3.7.2

D:\mastodon-backup\master\mastodon-backup-master>python setup.py py2exe
Traceback (most recent call last):
  File "setup.py", line 8, in <module>
    long_description=long_description,
NameError: name 'long_description' is not defined

use PyInstaller

D:\mastodon-backup\master\mastodon-backup-master>pyinstaller --version
3.4

Successfully get setup.exe ,but

D:\mastodon-backup\master\mastodon-backup-master\output\setup>setup.exe archive [email protected]
Traceback (most recent call last):
  File "setup.py", line 3, in <module>
FileNotFoundError: [Errno 2] No such file or directory: 'README.md'
[8688] Failed to execute script setup

paste 'README.md' in the folder,and run:

D:\mastodon-backup\master\mastodon-backup-master\output\setup>setup archive [email protected]
D:\mastodon-backup\master\mastodon-backup-master\output\setup\distutils\dist.py:274: UserWarning: Unknown distribution option: 'entry_points'
D:\mastodon-backup\master\mastodon-backup-master\output\setup\distutils\dist.py:274: UserWarning: Unknown distribution option: 'install_requires'
usage: setup [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: setup --help [cmd1 cmd2 ...]
   or: setup --help-commands
   or: setup cmd --help

error: invalid command 'archive'

then I use auto-py-to-exe, and also successfully get setup.exe,but get the same errors as pyinstaller.

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