Reputation: 31
I am getting the following error
"ModuleNotFoundError: No module named 'class1'"
Structure
- hello-world
- src
- __init__
- main
- class1
- Procfile
The main1
file looks like this:
from class1 import G
APP = Flask(__name__)
@APP.route('/', methods=['GET'])
def index() -> str:
return 'We are alive'
Profile:
web: gunicorn src.main:app --log-file -
The heroku logs shows us the following errors:
ModuleNotFoundError: No module named 'class1'
I don't know what I am doing wrong. I am using pipenv
to install dependencies and it contains gunicorn
.
Upvotes: 2
Views: 1842
Reputation: 93
should be like this
from hello-world.src.class1 import G
first rename your folder hello-world.. Python does not recognize operands to class name or folder name. it will return an error
Upvotes: -1