-
-
Notifications
You must be signed in to change notification settings - Fork 608
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot load submodule #18
Comments
It probably depends on how you are importing that submodule in main. When you run That changes the way you can import relative and absolute modules and how you structure them. If you share your code with me or something with the same structure that replicates the bug, maybe I can help you debug it better. I have a very similar project, and there are a couple things you can do to be able to run it directly with In my case, I have the equivalent of And in [uwsgi]
module = app.main
callable = app |
I am new to python, module loading mechanism in python confused me a lot. My project have more files and dependencies than I have descriped before, so I built another simpler project to make this issue reappear, located in my github repository. Branch Thanks for your help. |
@YTed Try with |
@frankjdelgado Same error with your solution. IMHO, this issue is caused by wrong module path configuration, changing import statement in invocation file helps nothing. |
@YTed I dowloaded your repo, made the following changes and it worked:
I couldn't find a way to make it work with the |
Thanks @frankjdelgado for the help! So, @YTed , your problem inspired me to add more specific documentation for those cases. I just created a new release with an example project using a Python package structure (like you). You can download the example project here. I also updated the README docs on how to use the ...and as an extra, I'm creating a pull request to your project, so you can see exactly what I changed to make it work. 🎉 Let me know if you still have problems after that, or otherwise, you can close this issue. |
Thanks @tiangolo and @frankjdelgado, it finally works. |
I have a project with structure below:
main.py
calls entry function defined inweb.py
, andweb.py
calls functions defined insubmodule
. It works fine with command linepython main.py
. Then I plan to deploy it under docker, withDockerfile
:Build and run, I got error:
Why did uwsgi cannot find submodule? Did I miss something?
The text was updated successfully, but these errors were encountered: