Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8353281
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T09:12:34+00:00 2026-06-09T09:12:34+00:00

I already asked this exact question a year ago. My application uses Python’s multiprocessing

  • 0

I already asked this exact question a year ago. My application uses Python’s multiprocessing module, which works fine when run from the command line, but when I package it as an executable using Pyinstaller, the multiple processes spawn as new instances of the original rather than running the function they are supposed to run. The advice given to me last time as well as everywhere else I look is to call multiprocessing.freeze_support() at the beginning of my if __name__ == "__main__": block, which I have been doing this whole time, but I am suddenly running into this issue again for some reason. What else could possibly be causing this?

Update: I have confirmed that the presence of the freeze_support() line does not affect this issue at all. Commenting it or uncommenting it gives the exact same behavior: copies of the main window are opened and sit there doing nothing. Here is the block where it is called, at the extreme end of my main Python module:

if __name__ == '__main__':
    freeze_support()

    # (A bunch of commented-out lines)
    main()
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T09:12:35+00:00Added an answer on June 9, 2026 at 9:12 am

    I am an idiot. (Well, maybe not, but it was entirely my fault) multiprocessing signals a process that it is a child process by running it with two additional arguments: the flag --multiprocessing-fork and a numerical handle to a pipe from the parent process. multiprocessing.freeze_support checks for the presence of this flag to decide whether to run the function specified for the child process, or the normal program. Anyway, my method of parsing command-line arguments altered sys.argv, which got rid of the flag and caused the child processes to act like new parent processes.

    So, the moral of the story is, never alter sys.argv. I switched to use optparse, which complains about the presence of the flag so I had to pass it a filtered list of arguments. Once I did this, the issue vanished.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

THIS USER HAS ALREADY ASKED THE EXACT DUPLICATE A FEW MINUTES AGO sql and
some time ago someone already asked this question and a few answers were given
I have already asked this question once for a solution in Python: python intersect
Possible Duplicate: Python Regular Expression Matching: ## ## I already asked this question, but
A time ago I already asked this question and I also got a good
I already asked this question but at that time I tought that the refresh
I've already asked this question on several forums, but without any good explanation of
I am sorry I have already asked this question on Superuser, but nobody answers
I have tried looking though several of the already asked question about this topic
I've asked this question already this week but am rephrasing it with the hope

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.