I've spend an inordinate amount of time over the last few weeks trying to get this to work. My goal is to create a simple web app using the flask framework but I keep getting errors, and hours of googling and searching stackoverflow have not helped.
I'm following a tutorial that requires me to run: $ python3 routes.py
Only for me to get the following error:
Traceback (most recent call last): File "routes.py", line 1, in from flask import Flask, render_template ImportError: No module named 'flask'
Ok so Flask is not installed? So apparently every site tells me to type $ pip install Flask
warning: no files found matching '' under directory 'tests' warning: no previously-included files matching '.pyc' found under directory 'docs' warning: no previously-included files matching '.pyo' found under directory 'docs' warning: no previously-included files matching '.pyc' found under directory 'tests' warning: no previously-included files matching '.pyo' found under directory 'tests' warning: no previously-included files matching '.pyc' found under directory 'examples'
...yada yada yada...
error: could not create '/Library/Python/2.7/site-packages/flask': Permission denied
OK great. I google that error and they tell me to type more magic incantations into the terminal. "Simply do this and it will work"... except it doesn't. Nothing works.
Is anyone willing to hold my hand through this? What should I do to get things working?
Joshua:~ Joshua$ sudo pip install flask Downloading/unpacking flask Downloading Flask-0.10.1.tar.gz (544kB): 544kB downloaded Running setup.py (path:/private/tmp/pip_build_root/flask/setup.py) egg_info for package flask
warning: no files found matching '*' under directory 'tests'
warning: no previously-included files matching '*.pyc' found under directory 'docs'
warning: no previously-included files matching '*.pyo' found under directory 'docs'
warning: no previously-included files matching '*.pyc' found under directory 'tests'
warning: no previously-included files matching '*.pyo' found under directory 'tests'
warning: no previously-included files matching '*.pyc' found under directory 'examples'
warning: no previously-included files matching '*.pyo' found under directory 'examples'
no previously-included directories found matching 'docs/_build'
no previously-included directories found matching 'docs/_themes/.git'
Downloading/unpacking Werkzeug>=0.7 (from flask) Downloading Werkzeug-0.9.4.tar.gz (1.1MB): 1.1MB downloaded Running setup.py (path:/private/tmp/pip_build_root/Werkzeug/setup.py) egg_info for package Werkzeug
warning: no files found matching '*' under directory 'werkzeug/debug/templates'
warning: no files found matching '*' under directory 'tests'
warning: no previously-included files matching '*.pyc' found under directory 'docs'
warning: no previously-included files matching '*.pyo' found under directory 'docs'
warning: no previously-included files matching '*.pyc' found under directory 'tests'
warning: no previously-included files matching '*.pyo' found under directory 'tests'
warning: no previously-included files matching '*.pyc' found under directory 'examples'
warning: no previously-included files matching '*.pyo' found under directory 'examples'
no previously-included directories found matching 'docs/_build'
Downloading/unpacking Jinja2>=2.4 (from flask) Downloading Jinja2-2.7.2.tar.gz (378kB): 378kB downloaded Running setup.py (path:/private/tmp/pip_build_root/Jinja2/setup.py) egg_info for package Jinja2
warning: no files found matching '*' under directory 'custom_fixers'
warning: no previously-included files matching '*' found under directory 'docs/_build'
warning: no previously-included files matching '*.pyc' found under directory 'jinja2'
warning: no previously-included files matching '*.pyc' found under directory 'docs'
warning: no previously-included files matching '*.pyo' found under directory 'jinja2'
warning: no previously-included files matching '*.pyo' found under directory 'docs'
Downloading/unpacking itsdangerous>=0.21 (from flask) Downloading itsdangerous-0.24.tar.gz (46kB): 46kB downloaded Running setup.py (path:/private/tmp/pip_build_root/itsdangerous/setup.py) egg_info for package itsdangerous
warning: no previously-included files matching '*' found under directory 'docs/_build'
Downloading/unpacking markupsafe (from Jinja2>=2.4->flask) Downloading MarkupSafe-0.19.tar.gz Running setup.py (path:/private/tmp/pip_build_root/markupsafe/setup.py) egg_info for package markupsafe
Installing collected packages: flask, Werkzeug, Jinja2, itsdangerous, markupsafe Running setup.py install for flask
warning: no files found matching '*' under directory 'tests'
warning: no previously-included files matching '*.pyc' found under directory 'docs'
warning: no previously-included files matching '*.pyo' found under directory 'docs'
warning: no previously-included files matching '*.pyc' found under directory 'tests'
warning: no previously-included files matching '*.pyo' found under directory 'tests'
warning: no previously-included files matching '*.pyc' found under directory 'examples'
warning: no previously-included files matching '*.pyo' found under directory 'examples'
no previously-included directories found matching 'docs/_build'
no previously-included directories found matching 'docs/_themes/.git'
Running setup.py install for Werkzeug
warning: no files found matching '*' under directory 'werkzeug/debug/templates'
warning: no files found matching '*' under directory 'tests'
warning: no previously-included files matching '*.pyc' found under directory 'docs'
warning: no previously-included files matching '*.pyo' found under directory 'docs'
warning: no previously-included files matching '*.pyc' found under directory 'tests'
warning: no previously-included files matching '*.pyo' found under directory 'tests'
warning: no previously-included files matching '*.pyc' found under directory 'examples'
warning: no previously-included files matching '*.pyo' found under directory 'examples'
no previously-included directories found matching 'docs/_build'
Running setup.py install for Jinja2
warning: no files found matching '*' under directory 'custom_fixers'
warning: no previously-included files matching '*' found under directory 'docs/_build'
warning: no previously-included files matching '*.pyc' found under directory 'jinja2'
warning: no previously-included files matching '*.pyc' found under directory 'docs'
warning: no previously-included files matching '*.pyo' found under directory 'jinja2'
warning: no previously-included files matching '*.pyo' found under directory 'docs'
Running setup.py install for itsdangerous
warning: no previously-included files matching '*' found under directory 'docs/_build'
Running setup.py install for markupsafe
building 'markupsafe._speedups' extension
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c markupsafe/_speedups.c -o build/temp.macosx-10.9-intel-2.7/markupsafe/_speedups.o
clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
==========================================================================
WARNING: The C extension could not be compiled, speedups are not enabled.
Failure information, if any, is above.
Retrying the build without the C extension now.
==========================================================================
WARNING: The C extension could not be compiled, speedups are not enabled.
Plain-Python installation succeeded.
==========================================================================
Successfully installed flask Werkzeug Jinja2 itsdangerous markupsafe Cleaning up...