this question has answer here:
to run flask examples off repo, clone latest stable, create virtual environment, activate it, pip install flask, , try run flaskr.py. following script goes through sequence.
#!/bin/bash newroot=${home}/flask mkdir $newroot git clone https://github.com/mitsuhiko/flask.git $newroot/repo virtualenv $newroot/venv source $newroot/venv/bin/activate pip install flask cd $newroot/repo/examples/flaskr/ python flaskr.py the last line fails with
traceback (most recent call last): file "flaskr.py", line 48, in <module> @app.cli.command('initdb') attributeerror: 'flask' object has no attribute 'cli' what missing?
in context not understand: if not run "pip install flask", get
traceback (most recent call last): file "flaskr.py", line 15, in <module> flask import flask, request, session, g, redirect, url_for, abort, \ importerror: no module named flask if do, earlier error. hence appears "pip install flask" did indeed install flask, don't see flask (not symlink) in newly created ${home}/flask/venv. flask installed?
python 2.7.10 (from macports); pip 1.5.6; os x 10.9.5
app.cli feature in v1.0 branch of flask, not in main 0.10 branch stable branch default pip. either install v1.0 pip, or delete part of code.
Comments
Post a Comment