Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

cannot import name 'create app' from website// python ImportError

from website import create_app 

app = create_app()

if __name__ == '__main__':
    app.run(debug=True)

Even though I have installed Module website in vs (pip install website) I get an ImportError that I cannot import ‘create app’ from website

from flask import Flask

def create_app():
    app = Flask(__name__)
    app.config['SECRET_KEY'] = 'hfahuhsfuiahdfuhai juueioudiu'

    return app

At first I had an ModuleError because I hadn’t a module named ‘website’. Now I have but there’s the ImportError I try asking Chatgpt but it didn’t worked out to me

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

When you installed the website module, you installed this module, which has the description "HTML to HTML transformer". There is no documentation or a link to the source code which means that we don’t know what you have installed without downloading it ourselves.

If you do not do the following already, I’d recommend you to search for packages on PyPI before installing them so you know what they are and are not cluttering your environment. If you ask ChatGPT for help on software, keep in mind that these models have been (currently) trained with available data, which means that they are primarily able to write code for using popular (Python) packages.

I recommend you to follow a tutorial. If you want to create a Flask app, you can find a comprehensive one here.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading