Where is the huey configuration for consumers?

I am trying to start the Huey task queue for python (this is an alternative to Celery) and I am stuck in starting a consumer with main.Configuration (as written in the tutorial ). I know that huey_consumer is looking for a configuration file somewhere in python, but I can't get it to work as per the tutorial, and I don't know why I have to write a configuration file and load it as a module (not a file).

When I run huey_consumer.py main.Configuration , it returns Unable to import "main" .

In Huey, this problem is written in their common problems , but this also does not help.

If someone uses Huey, please help me.

+7
source share
3 answers

I had the same problem and it was solved by adding the directory containing main.py to PYTHONPATH. No need to copy huey_consumer.py

+2
source

So, how it works, it tries to import the "main" module. This would be equivalent to opening a python shell and running:

 >>> from main import Configuration 

Perhaps you can answer with additional information about your environment, the layout of your files, what you are using, etc.

0
source

I think you need to add the __init__.py file to the folder containing main.py, ... otherwise you will not be able to import anything, since python will not treat this folder as a module.

What is the difference between a Python module and a Python package?

See comment from giulio-piancastelli

0
source

All Articles