Closed R055A closed 3 months ago
hmm... this gave me the following error:
py spotkin
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "C:\RC Dropbox\Rivers Cuomo\Apps\spotkin\spotkin\__main__.py", line 6, in <module>
from .scripts.process_job import process_job
ImportError: attempted relative import with no known parent package
The try/except blocks are not pretty but they're working for my purposes.
hmm... this gave me the following error:
py spotkin Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "C:\RC Dropbox\Rivers Cuomo\Apps\spotkin\spotkin\__main__.py", line 6, in <module> from .scripts.process_job import process_job ImportError: attempted relative import with no known parent package
The try/except blocks are not pretty but they're working for my purposes.
Hi @riverscuomo
Thank you for the quick response.
Try py -m spotkin
as instructed in the README.md
. The -m
flag is required for the relative imports.
The relative import changes worked for me when using the -m
flag.
Testing passed when running the app as a 'standalone command line script' and when running the server with flask, seemingly resolving #23
I tested using an Anaconda environment with the commands python -m spotkin
and flask run
, but it shouldn't matter which environment is used so long that the -m
flag is included with the python command.
Fixes #23
Refactor import statements in the
__main__.py
file to use relative imports instead of a try-except block.Before
After