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

Documentation Suggestion re: concurrent.futures #67

Closed
William-Lake opened this issue Aug 16, 2019 · 5 comments
Closed

Documentation Suggestion re: concurrent.futures #67

William-Lake opened this issue Aug 16, 2019 · 5 comments

Comments

@William-Lake
Copy link

Hi Brent,

First off- thanks again for this project! I've been using it a ton and I really appreciate you taking the time to put it together.

I'm opening this issue to share a minor hurdle I came across today which only came up after packaging my project. The issue has nothing to do with auto-py-to-exe as it turns out, but the fix was so easy that I'm hoping by posting the solution here it may help out someone else with a similar problem.


If the script(s) you're packaging use concurrent.futures for any multi-threading/processing then you'll want to add the following to your imports:

from multiprocessing import freeze_support

and this to your main:

freeze_support()

Before adding this I kept getting errors re: concurrent.futures when trying to run the packaged project, even when everything worked fine before packaging it. After some troubleshooting/Googling I came across this StackOverflow entry which led me to this bug report (see the second entry by Torsten Landschoff.)

After making the minor change, my project ran without issue as a one-file .exe.

This is a pretty specific use-case, so I'm uncertain if it would be helpful to add this to the documentation as a "pro-tip" (if at all considering the root cause wasn't auto-py-to-exe.) I figured I might as well bring it up either way- if you'd like me to add it somewhere and submit a pull request I'd be happy to do so.

Thanks Brent!

@brentvollebregt
Copy link
Owner

Oh wow, that's something I have not come across before, thanks for pointing this out!

I think the best way to address this would be to add it to the help post I've been adding to which is linked at the bottom of the UI after every build. I know adding this to the user's script is an option but I am not too keen on directly manipulating a user's program as it could cause other side effects.

I'll close this issue when I get some time to add it; thank you very much!

brentvollebregt added a commit to brentvollebregt/nitratine.net that referenced this issue Sep 1, 2019
@brentvollebregt
Copy link
Owner

brentvollebregt commented Sep 1, 2019

I've just added a section to the help post. Sorry for the delay.

Thank you very much for reporting this, it's very helpful that this issue is available for others with similar issues.

@William-Lake
Copy link
Author

Hey! Sorry for my (incredibly late) reply- I'm happy to help!

@nednoodlehead
Copy link

Is there any fix for threading? I seem to have a similar issue where command prompt (windows) opens and closes immediately every time I create a thread

@brentvollebregt
Copy link
Owner

@nednoodlehead can you open a new issue with a minimum reproducible example? It sounds like your problem would be better in a new issue rather than this documentation one.

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

No branches or pull requests

3 participants