mac 安装完 fish shell 以前用 pip 安装的东西都不能用了

2016-11-21 12:07:55 +08:00
 Loneyer

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 但是却无法调用。
2483 次点击
所在节点    Python
5 条回复
Ellen
2016-11-21 14:07:55 +08:00
是不是移动或者拷贝过虚拟环境?
Loneyer
2016-11-21 14:15:31 +08:00
我这没有建立虚拟环境。
Loneyer
2016-11-21 14:15:47 +08:00
@Ellen 我这没有建立虚拟环境。
warcraft1236
2016-11-21 16:34:59 +08:00
如果退出 fish 再调用正常吗?如果正常就看一下进入 fish 之后, Python 命令行下边的 path 是不是改变了,导致找不到 flask
lcy
2016-11-21 16:38:36 +08:00
检查环境变量

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/322036

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX