Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
607 views
in Technique[技术] by (71.8m points)

python - Installed Flask in a virtualenv yet "command not found"

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)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

Also tried:

(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$ 
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Flask 0.10 has no flask command, it was added in 0.11. If pi.py has the smarts to run your app, such as if it's using Flask-Script, the command you're looking for is:

$ python pi.py

You can install Flask-CLI to get the flask command in 0.10 if you can't upgrade to 0.11.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...