当前位置: 动力学知识库 > 问答 > 编程问答 >

python - virtualenv: "cannot import name 'Flask'"

问题描述:

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'.

分享给朋友:
您可能感兴趣的文章:
随机阅读: