无法找到带烧瓶的flask.ext.pagedown模块

时间:2015-03-21 01:26:56

标签: python flask pagedown

我正在尝试在我的机器上设置一些带有flask + python的示例代码,我正在关注以下网站

http://blog.miguelgrinberg.com/post/flask-pagedown-markdown-editor-extension-for-flask-wtf

但是我有一个问题如下。

from flask.ext.pagedown import PageDown


Traceback (most recent call last):
  File "/Users/iMacBin/Documents/projects/flask/flasky/manage.py", line 3, in <module>
    from app import create_app, db
  File "/Users/iMacBin/Documents/projects/flask/flasky/app/__init__.py", line 7, in <module>
    from flask.ext.pagedown import PageDown
  File "/Library/Python/2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/exthook.py", line 87, in load_module
    raise ImportError('No module named %s' % fullname)
ImportError: No module named flask.ext.pagedown

我确实在我的机器上使用pip安装了烧瓶页面,降价和漂白。

(venv) $ pip install flask-pagedown markdown bleach

我在线搜索并注意到flask.ext可能是陈旧的,所以我也尝试了

from flask_pagedown import PageDown

但它有同样的问题,&#39;没有名为flask_pagedown的模块&#39;

仅供参考,我的python版本是2.7.6。我使用的IDE是PyCharm。

有人可以提出任何我可以检查的建议吗?

1 个答案:

答案 0 :(得分:1)

我无法告诉你问题是什么,但它至少在我的目的中起作用..

(env)➜ ocmg-py-frontend git:(master) ✗ pip install flask-pagedown
Collecting flask-pagedown
  Downloading https://devpi.ocx.dk/root/pypi/+f/73a/4fb383fcd4e1f/Flask-PageDown-0.1.5.tar.gz
Requirement already satisfied (use --upgrade to upgrade): Flask in ./env/lib/python2.7/site-packages (from flask-pagedown)
Collecting WTForms (from flask-pagedown)
  Downloading https://devpi.ocx.dk/root/pypi/+f/364/4164ce003ef52/WTForms-2.0.2-py27-none-any.whl (128kB)
    100% |################################| 131kB 2.0MB/s
Requirement already satisfied (use --upgrade to upgrade): Werkzeug>=0.7 in ./env/lib/python2.7/site-packages (from Flask->flask-pagedown)
Requirement already satisfied (use --upgrade to upgrade): Jinja2>=2.4 in ./env/lib/python2.7/site-packages (from Flask->flask-pagedown)
Requirement already satisfied (use --upgrade to upgrade): itsdangerous>=0.21 in ./env/lib/python2.7/site-packages (from Flask->flask-pagedown)
Requirement already satisfied (use --upgrade to upgrade): markupsafe in ./env/lib/python2.7/site-packages (from Jinja2>=2.4->Flask->flask-pagedown)
Installing collected packages: WTForms, flask-pagedown

  Running setup.py install for flask-pagedown
Successfully installed WTForms-2.0.2 flask-pagedown-0.1.5
(env)➜ ocmg-py-frontend git:(master) ✗ python
Python 2.7.9 (default, Jan  7 2015, 11:49:12)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.56)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from flask.ext.pagedown import PageDown
>>>