看了好几个教程,安装过程没有太多坑,实际安装过程也很顺利,直到cmd运行。。。。command not found。。。。。
https://blog.csdn.net/testcs_...
主要参考:https://blog.csdn.net/CUFE_pa...
重新安装看起来也没啥问题:
ancysMac:ancysweb ancyhuang$ sudo pip install Flask
Password:
The directory '/Users/xx/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/xx/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already satisfied: Flask in /Library/Python/2.7/site-packages (0.10.1)
Requirement already satisfied: Werkzeug>=0.7 in /Library/Python/2.7/site-packages (from Flask) (0.14.1)
Requirement already satisfied: Jinja2>=2.4 in /Library/Python/2.7/site-packages (from Flask) (2.10)
Requirement already satisfied: itsdangerous>=0.21 in /Library/Python/2.7/site-packages (from Flask) (1.1.0)
Requirement already satisfied: MarkupSafe>=0.23 in /Library/Python/2.7/site-packages (from Jinja2>=2.4->Flask) (1.1.0)
但是一运行:
ancysMac:ancysweb ancyhuang$ flask
-bash: flask: command not found
你先在command 里面用pip list 查看有没有 flask

然后再写个测试demo.py
然后 python demo.py