安装了virtualenv,激活了它,安装了pip的flask,但是,当我尝试运行脚本或查看是否可以识别时,找不到命令。
(project)gabriel@debian:~/project$ pip list Flask (0.10.1) itsdangerous (0.24) Jinja2 (2.7.3) MarkupSafe (0.23) pip (1.5.6) setuptools (5.5.1) Werkzeug (0.10.4) (project)gabriel@debian:~/project$ flask -bash: flask: command not found (project)gabriel@debian:~/project$ Flask -bash: Flask: command not found (project)gabriel@debian:~/project$ </3
还尝试了:
(project)gabriel@debian:~/project$ python -m flask pi.py /home/gabriel/project/bin/python: No module named flask.__main__; 'flask' is a package and cannot be directly executed (project)gabriel@debian:~/project$
Flask 0.10没有flask命令,它是在0.11中添加的。如果pi.py具有运行你的应用程序的技巧,例如使用Flask-Script,那么你要查找的命令是:
pi.py
$ python pi.py
如果无法升级到0.11,则可以安装Flask-CLI以flask在0.10中获取命令。
flask