Here's my directory structure:
python
-main
-api
-__init__.py
-tests
-__init__.py
-wsgi.py
wsgi contains the following code:
from .main import api
app = api.create_app()
if __name__ == '__main__':
app.run(port=8080)
but, when I try to run the code I get the following error:
Traceback (most recent call last): File
"/Users/unbp/projects/webservices/fund-distribution.webservice/python/wsgi.py",
line 1, in <module>
from .main import api ImportError: attempted relative import with no known parent package
The parent folder 'python' does contain __init__.py
file, so it is a package, isn't it?
It works fine with from main import api
(without dot in front of main)
Where am I going wrong?