Installed Flask in a virtualenv yet “command not found”

后端 未结 8 919
暗喜
暗喜 2020-12-14 19:36

Installed virtualenv, activated it, pip installed flask, and yet, when i try to run a script or see if it recognised, i get command not found.

(project)gabri         


        
8条回答
  •  生来不讨喜
    2020-12-14 19:59

    I have used Flask 0.10.1 and to verify whether it's install you should activate the virtualenv and then type:

    $ python
    >>> from flask import Flask
    

    if it runs smoothly, you have it. To run the app you can either use

    app = Flask(__name__)
    app.run(debug=True)
    

    or use flask_script :

    from flask_script import Manager
    manager = Manager(app)
    manager.run
    

    Hope this helps you

提交回复
热议问题