V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
Loneyer
V2EX  ›  Python

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

  •  
  •   Loneyer · 2016-11-21 12:07:55 +08:00 · 2457 次点击
    这是一个创建于 2925 天前的主题,其中的信息可能已经有所发展或是发生改变。

    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 但是却无法调用。
    5 条回复    2016-11-21 16:38:36 +08:00
    Ellen
        1
    Ellen  
       2016-11-21 14:07:55 +08:00
    是不是移动或者拷贝过虚拟环境?
    Loneyer
        2
    Loneyer  
    OP
       2016-11-21 14:15:31 +08:00
    我这没有建立虚拟环境。
    Loneyer
        3
    Loneyer  
    OP
       2016-11-21 14:15:47 +08:00
    @Ellen 我这没有建立虚拟环境。
    warcraft1236
        4
    warcraft1236  
       2016-11-21 16:34:59 +08:00
    如果退出 fish 再调用正常吗?如果正常就看一下进入 fish 之后, Python 命令行下边的 path 是不是改变了,导致找不到 flask
    lcy
        5
    lcy  
       2016-11-21 16:38:36 +08:00
    检查环境变量
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1233 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 17:37 · PVG 01:37 · LAX 09:37 · JFK 12:37
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.