pip install flask
Requirement already satisfied: flask in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
Requirement already satisfied: click>=2.0 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from flask)
Requirement already satisfied: Jinja2>=2.4 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from flask)
Requirement already satisfied: Werkzeug>=0.7 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from flask)
Requirement already satisfied: itsdangerous>=0.21 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from flask)
Requirement already satisfied: MarkupSafe in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from Jinja2>=2.4->flask)
python
Python 2.7.10 (default, Jul 30 2016, 18:31:42)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
from flask import Flask
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named flask
上面提示已经安装了 flask 但是却无法调用。
1
Ellen 2016-11-21 14:07:55 +08:00
是不是移动或者拷贝过虚拟环境?
|
2
Loneyer OP 我这没有建立虚拟环境。
|
4
warcraft1236 2016-11-21 16:34:59 +08:00
如果退出 fish 再调用正常吗?如果正常就看一下进入 fish 之后, Python 命令行下边的 path 是不是改变了,导致找不到 flask
|
5
lcy 2016-11-21 16:38:36 +08:00
检查环境变量
|