Python: Do relative imports mean you can't execute a subpackage by itself? -
I recently ported my Python project to run on Python 3.1. For this, I had to adopt a policy of relative import within the subdomules and subpages of my project. I have not done this and now the project works only, but I have seen that I can not execute any subpages or submissions in it. If I try, then "buildins.ValueError: tried to import relative to non-package" I can only import the entire project.
Is this normal?
You can use the M-flag of Python interpreter to run the module in a sub-package (Or even package in 3.1).
Comments
Post a Comment