问题描述:

This question already has an answer here:

  • Importing installed package from script raises “AttributeError: module has no attribute” or “ImportError: cannot import name”

    1 answer

网友答案:

I don't see your file structure, so I can't be sure, but if you have a file called flask.py in the same folder, python will import it instead of the Flask module

网友答案:

I think this is the answer:

/_workspace/py/flask python helloworld.py

use underscope '_' in names, python thinks you want to import flask from you 'flask python helloworld'.

相关阅读:
Top