joblib AttributeError: 'module' object has no attribute

Ho Yeung Lee jobmattcon at
Sat Apr 14 07:51:58 EDT 2018

Process PoolWorker-1:
Traceback (most recent call last):
  File "C:\Python27\lib\multiprocessing\", line 258, in _bootstrap
  File "C:\Python27\lib\multiprocessing\", line 114, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Python27\lib\multiprocessing\", line 102, in worker
    task = get()
  File "C:\Python27\lib\site-packages\joblib\", line 362, in get
    return recv()
AttributeError: 'module' object has no attribute 'easysearch'

how to solve this bug?

import re
import string
from itertools import permutations
from itertools import combinations
from joblib import Parallel, delayed
import multiprocessing
from multiprocessing import Process, freeze_support

all_normal_characters = string.ascii_letters + string.digits
def is_special(character):
    return character not in all_normal_characters

def easysearch(content):
    if len(str(content[0]).strip()) == 0 or len(str(content[1]).strip()) == 0:
        return ""
    row1 = content[0]
    keywords = content[1]

num_cores = multiprocessing.cpu_count()

def segmentsearch(content, findwhat, lensize):
    chunks, chunk_size = len(content), lensize
    result = Parallel(n_jobs=num_cores)(delayed(easysearch)([content[j:j+chunk_size], findwhat]) for j in range(0, chunks, chunk_size))
    return result

def main():
    result = segmentsearch("search key    $  @   $  wrds today", "key words", 77)

if __name__=="__main__":

More information about the Python-list mailing list