Skip to content

worker function not found #9

@peetasan

Description

@peetasan

I am running the worker based on the README and get the following error after POSTing a url

$ python worker.py
22:45:34 RQ worker 'rq:worker:P6s-MacBook-Pro-2.33821' started, version 0.5.6
22:45:34
22:45:34 *** Listening on default...
22:45:46 default: __main__.count_and_save_words('http://index.hu') (aed5e21f-5b70-44c0-96d8-57845638cda0)
22:45:46 AttributeError: module '__main__' has no attribute 'count_and_save_words'
Traceback (most recent call last):
  File "/Users/peetasan/dev/flask-by-example/virtualenv/lib/python3.6/site-packages/rq/worker.py", line 568, in perform_job
    rv = job.perform()
  File "/Users/peetasan/dev/flask-by-example/virtualenv/lib/python3.6/site-packages/rq/job.py", line 495, in perform
    self._result = self.func(*self.args, **self.kwargs)
  File "/Users/peetasan/dev/flask-by-example/virtualenv/lib/python3.6/site-packages/rq/job.py", line 206, in func
    return import_attribute(self.func_name)
  File "/Users/peetasan/dev/flask-by-example/virtualenv/lib/python3.6/site-packages/rq/utils.py", line 151, in import_attribute
    return getattr(module, attribute)
AttributeError: module '__main__' has no attribute 'count_and_save_words'
Traceback (most recent call last):
  File "/Users/peetasan/dev/flask-by-example/virtualenv/lib/python3.6/site-packages/rq/worker.py", line 568, in perform_job
    rv = job.perform()
  File "/Users/peetasan/dev/flask-by-example/virtualenv/lib/python3.6/site-packages/rq/job.py", line 495, in perform
    self._result = self.func(*self.args, **self.kwargs)
  File "/Users/peetasan/dev/flask-by-example/virtualenv/lib/python3.6/site-packages/rq/job.py", line 206, in func
    return import_attribute(self.func_name)
  File "/Users/peetasan/dev/flask-by-example/virtualenv/lib/python3.6/site-packages/rq/utils.py", line 151, in import_attribute
    return getattr(module, attribute)
AttributeError: module '__main__' has no attribute 'count_and_save_words'
22:45:46 Moving job to 'failed' queue

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions