Issues starting and importing huey from different folder
See original GitHub issueIssue Description
I have this folder structure.
huey_test init.py main.py huey_test/config init.py config.py huey_test/tasks init.py tasks.py
I modified main.py to import like the following…
from config.config import huey
from tasks.tasks import count_beans
I would expect this to work but I get “ImportError: cannot import name ‘huey’” when running huey_consumer.exe main.huey.
If I leave the config.py in the same folder as the main but move tasks it works by doing…
from config import huey
from tasks.tasks import count_beans
How can I import everything appropriately in a different folder structure?
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Where is the huey consumer configuration? - Stack Overflow
When I run huey_consumer.py main.Configuration it returns Unable to import "main" . Huey have this issue written in their common pitalls too, ...
Read more >Consuming Tasks — huey 2.4.4 documentation - Read the Docs
Run huey_consumer.py from the directory your config module is in. I use supervisord to manage my huey process, so I set the directory...
Read more >Chapter 1. Importing data to Directory Server
When you start an import operation, Directory Server first removes all existing data from the database and, subsequently, imports the data from the...
Read more >Import preferences in Final Cut Pro - Apple Support
From folders: Creates a Keyword Collection for each folder in the files you're importing. Select this option to preserve the file organization that...
Read more >Export and import canvas app packages - Power Apps
This feature allows you to export an app from one environment and import it to another. When exporting and importing canvas app packages, ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I apologize. I see what I did wrong. Nothing was wrong with my imports in the actual python code, but what was being sent to huey_consumer.py as the parameters.
I had:
C:\Users<username>Documents\dev\huey_test> python "C:\Program Files\Anaconda3\Scripts\huey_consumer.py" **hueytest\main.huey**
I thought you were looking for an actual PATH to the object and not the object itself. So instead of
hueytest\main.huey
I should have senthueytest.main.huey
as the parameters.This is for anyone else that runs into the same problem.
I’m a beginner and I came here being tired of trying to configure celery with Django. I’m having a hard time understanding how to run a simple taks with Huey also, so I’m either too dumb, or the documentation is not clear enough.
https://github.com/coleifer/huey/issues/410 in this issue you said you’re not going to repeat yourself. That’s actually the problem with the docs, I believe. In the Django section, it assumes the reader already knows how to use huey standalone, while I don’t really care about that. I just want to plug it into my Django app and run tasks.