Flask没有在virtualenv中导入

时间:2017-03-11 21:41:10

标签: python flask

安装烧瓶:

(cloud_computing)  ⚙     master  pip install Flask  
Collecting Flask
  Using cached Flask-0.12-py2.py3-none-any.whl
Requirement already satisfied: itsdangerous>=0.21 in ./cloud_computing/lib/python2.7/site-packages (from Flask)
Requirement already satisfied: click>=2.0 in ./cloud_computing/lib/python2.7/site-packages (from Flask)
Requirement already satisfied: Werkzeug>=0.7 in ./cloud_computing/lib/python2.7/site-packages (from Flask)
Requirement already satisfied: Jinja2>=2.4 in ./cloud_computing/lib/python2.7/site-packages (from Flask)
Requirement already satisfied: MarkupSafe>=0.23 in ./cloud_computing/lib/python2.7/site-packages (from Jinja2>=2.4->Flask)
Installing collected packages: Flask
Successfully installed Flask-0.12

检查是否已安装

(cloud_computing)  ⚙     master  pip list         
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
appdirs (1.4.3)
click (6.7)
Flask (0.12)
geopy (1.11.0)
itsdangerous (0.24)
Jinja2 (2.9.5)
MarkupSafe (1.0)
oauthlib (2.0.1)
packaging (16.8)
pip (9.0.1)
pyparsing (2.2.0)
requests (2.13.0)
requests-oauthlib (0.8.0)
setuptools (34.3.2)
six (1.10.0)
tweepy (3.5.0)
Werkzeug (0.12)
wheel (0.29.0)



 (cloud_computing)  ⚙     master  pip show Flask
    Name: Flask
    Version: 0.12
    Summary: A microframework based on Werkzeug, Jinja2 and good intentions
    Home-page: http://github.com/pallets/flask/
    Author: Armin Ronacher
    Author-email: armin.ronacher@active-4.com
    License: BSD
    Location: /home/abhishek/Dropbox/columbia_docs/cloud_computing/cloud_computing_twittmap/cloud_computing/lib/python2.7/site-packages
    Requires: itsdangerous, click, Werkzeug, Jinja2

导入错误!!!

(cloud_computing)  ⚙     master  python -c "import Flask"          
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    ImportError: No module named Flask

(cloud_computing)  ✘ ⚙     master  python -c "import flask"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "flask.py", line 1, in <module>
    from flask import Flask
ImportError: cannot import name Flask

我的virtualenv被激活,因为(cloud_computing)会在提示符处显示。不知道这里的问题是什么。在堆栈上看到其他问题,但对我的案例没有有用的回应。

0 个答案:

没有答案