question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error starting up `Client`

See original GitHub issue

The following chunk of code fails:

from distributed.client import *
import time

client = Client()

time.sleep(5)
print('five seconds later')

with:

distributed.utils - ERROR - 
        An attempt has been made to start a new process before the
        current process has finished its bootstrapping phase.

        This probably means that you are not using fork to start your
        child processes and you have forgotten to use the proper idiom
        in the main module:

            if __name__ == '__main__':
                freeze_support()
                ...

        The "freeze_support()" line can be omitted if the program
        is not going to be frozen to produce an executable.

(plus a long traceback)

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

17reactions
mrocklincommented, Jun 6, 2017

By default Client() forks processes. If you use it within a module you should hide it within the __main__ block.

# client = Client()

if __name__ == '__main__':
    client = Client()
    ...

Alternatively you can choose to use threads safely.

client = Client(processes=False)
0reactions
wholmgrencommented, Jun 6, 2017

Ah, of course. Thanks. Sorry for the noise.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error starting up Eureka Client with Spring Boot 2.4.1
I achieved to start up the Eureka Server, but with the Eureka Client I am getting the following error: Caused by: java.lang.
Read more >
Weird Gateway Logs: Full of starting up client project monitor ...
My gateway logs are full of these messages, especially number 1. Starting up client project monitor. project=PackingStation scope=4 ...
Read more >
Troubleshoot Start menu errors - Windows Client
Learn how to troubleshoot common Start menu errors in Windows 10. For example, learn to troubleshoot errors related to deployment, crashes, ...
Read more >
Fix Valorant Not Launching Error - Couldn't Start Solution
This tutorial will show you how to fix Valorant not launching error. There are a few possible solutions to fix Valorant if it...
Read more >
Solved: SC3020: Dell storage client "error setting up connection"
3) Verify if the Service shows as running in the General Information Tab If it is running select to stop and restart If...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found