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 216867
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T18:36:15+00:00 2026-05-11T18:36:15+00:00

I tried to copy this example from this Multiprocessing lecture by jesse noller (as

  • 0

I tried to copy this example from this Multiprocessing lecture by jesse noller (as recommended in another SO post)[http://pycon.blip.tv/file/1947354?filename=Pycon-IntroductionToMultiprocessingInPython630.mp4%5D

But for some reason I’m getting an error, as though it’s ignoring my function definitions:
I’m on Windows XP (win32) which I know has restrictions with regards to the multiprocessing library in 2.6 that requires everything be pickleable

from multiprocessing import Process
import time

def sleeper(wait):
    print 'Sleeping for %d seconds' % (wait,)
    time.sleep(wait)
    print 'Sleeping complete'

def doIT():    
    p = Process(target=sleeper, args=(9,))
    p.start()
    time.sleep(5)
    p.join()

if __name__ == '__main__':
    doIT()

Output:

Evaluating mypikklez.py
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Python26\lib\multiprocessing\forking.py", line 342, in main
    self = load(from_parent)
  File "C:\Python26\lib\pickle.py", line 1370, in load
    return Unpickler(file).load()
  File "C:\Python26\lib\pickle.py", line 858, in load
    dispatch[key](self)
  File "C:\Python26\lib\pickle.py", line 1090, in load_global
    klass = self.find_class(module, name)
  File "C:\Python26\lib\pickle.py", line 1126, in find_class
    klass = getattr(mod, name)
AttributeError: 'module' object has no attribute 'sleeper'

The error causing the issue is : AttributeError: ‘module’ object has no attribute ‘sleeper’

As simple of a function as it is I can’t understand what would be the hold up.

This is just for self-teaching purposes of basic concepts. I’m not trying to pre-optimize any real world issue.

Thanks.

  • 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-05-11T18:36:16+00:00Added an answer on May 11, 2026 at 6:36 pm

    Seems from the traceback that you are running the code directly into the python interpreter (REPL).

    Don’t do that. Save the code in a file and run it from the file instead, with the command:

    python myfile.py
    

    That will solve your issue.


    As an unrelated note, this line is wrong:

    print 'Sleeping for ' + wait + ' seconds'
    

    It should be:

    print 'Sleeping for %d seconds' % (wait,)
    

    Because you can’t concatenate string and int objects (python is strongly typed)

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

Sidebar

Ask A Question

Stats

  • Questions 106k
  • Answers 106k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I think Eugene's reply in this thread is properly describing… May 11, 2026 at 8:55 pm
  • Editorial Team
    Editorial Team added an answer OK, this seems to be some kind of backwards compatibility… May 11, 2026 at 8:55 pm
  • Editorial Team
    Editorial Team added an answer Do you want to build your application so that it… May 11, 2026 at 8:55 pm

Related Questions

I have an third part dll that have a function that returns a string.
So I was playing around the other day just to see exactly how mass
I would like to open a small video file and map every frames in
Oracle 10g Application Server, Java 1.5 + JSF (presentation layer) + iBatis (database communication
I asked this question previously but the answers weren't what I was looking for.

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.