Skip to content
This repository has been archived by the owner on Dec 7, 2017. It is now read-only.

Doesn't work #1

Closed
robsonpeixoto opened this issue Jan 18, 2014 · 8 comments
Closed

Doesn't work #1

robsonpeixoto opened this issue Jan 18, 2014 · 8 comments

Comments

@robsonpeixoto
Copy link

Log from GoogleAppEngineLauncher.app 1.8.9.1049

*** Running dev_appserver with the following flags:
    --skip_sdk_update_check=yes --port=8080 --admin_port=8000
Python command: /opt/local/bin/python2.7
INFO     2014-01-18 12:22:14,967 devappserver2.py:671] Skipping SDK update check.
INFO     2014-01-18 12:22:15,003 api_server.py:138] Starting API server at: http://localhost:58042
INFO     2014-01-18 12:22:15,008 dispatcher.py:171] Starting module "default" running at: http://localhost:8080
INFO     2014-01-18 12:22:15,016 admin_server.py:117] Starting admin server at: http://localhost:8000
ERROR    2014-01-18 12:22:24,884 wsgi.py:262] 
Traceback (most recent call last):
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/runtime/wsgi.py", line 239, in Handle
    handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/runtime/wsgi.py", line 298, in _LoadHandler
    handler, path, err = LoadObject(self._handler)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/runtime/wsgi.py", line 84, in LoadObject
    obj = __import__(path[0])
  File "/Users/robinho/financeiro/main.py", line 10, in <module>
    from flask import Flask
  File "/Users/robinho/financeiro/server/lib/flask/__init__.py", line 17, in <module>
    from werkzeug.exceptions import abort
  File "/Users/robinho/financeiro/server/lib/werkzeug/__init__.py", line 20, in <module>
    from werkzeug._compat import iteritems
  File "/Users/robinho/financeiro/server/lib/werkzeug/werkzeug/__init__.py", line 154, in <module>
    __import__('werkzeug.exceptions')
  File "/Users/robinho/financeiro/server/lib/werkzeug/werkzeug/exceptions.py", line 71, in <module>
    from werkzeug.wrappers import Response
  File "/Users/robinho/financeiro/server/lib/werkzeug/werkzeug/wrappers.py", line 26, in <module>
    from werkzeug.http import HTTP_STATUS_CODES, \
  File "/Users/robinho/financeiro/server/lib/werkzeug/werkzeug/http.py", line 971, in <module>
    from werkzeug.datastructures import Accept, HeaderSet, ETags, Authorization, \
  File "/Users/robinho/financeiro/server/lib/werkzeug/werkzeug/datastructures.py", line 2612, in <module>
    from werkzeug import exceptions
ImportError: cannot import name exceptions
INFO     2014-01-18 12:22:24,911 module.py:612] default: "GET / HTTP/1.1" 500 -
ERROR    2014-01-18 12:22:25,175 wsgi.py:262] 
Traceback (most recent call last):
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/runtime/wsgi.py", line 239, in Handle
    handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/runtime/wsgi.py", line 298, in _LoadHandler
    handler, path, err = LoadObject(self._handler)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/runtime/wsgi.py", line 84, in LoadObject
    obj = __import__(path[0])
  File "/Users/robinho/financeiro/main.py", line 10, in <module>
    from flask import Flask
  File "/Users/robinho/financeiro/server/lib/flask/__init__.py", line 17, in <module>
    from werkzeug.exceptions import abort
  File "/Users/robinho/financeiro/server/lib/werkzeug/__init__.py", line 20, in <module>
    from werkzeug._compat import iteritems
  File "/Users/robinho/financeiro/server/lib/werkzeug/werkzeug/__init__.py", line 154, in <module>
    __import__('werkzeug.exceptions')
  File "/Users/robinho/financeiro/server/lib/werkzeug/werkzeug/exceptions.py", line 71, in <module>
    from werkzeug.wrappers import Response
  File "/Users/robinho/financeiro/server/lib/werkzeug/werkzeug/wrappers.py", line 26, in <module>
    from werkzeug.http import HTTP_STATUS_CODES, \
  File "/Users/robinho/financeiro/server/lib/werkzeug/werkzeug/http.py", line 971, in <module>
    from werkzeug.datastructures import Accept, HeaderSet, ETags, Authorization, \
  File "/Users/robinho/financeiro/server/lib/werkzeug/werkzeug/datastructures.py", line 2612, in <module>
    from werkzeug import exceptions
ImportError: cannot import name exceptions
INFO     2014-01-18 12:22:25,186 module.py:612] default: "GET / HTTP/1.1" 500 -
ERROR    2014-01-18 12:22:26,134 wsgi.py:262] 
Traceback (most recent call last):
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/runtime/wsgi.py", line 239, in Handle
    handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/runtime/wsgi.py", line 298, in _LoadHandler
    handler, path, err = LoadObject(self._handler)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/runtime/wsgi.py", line 84, in LoadObject
    obj = __import__(path[0])
  File "/Users/robinho/financeiro/main.py", line 10, in <module>
    from flask import Flask
  File "/Users/robinho/financeiro/server/lib/flask/__init__.py", line 17, in <module>
    from werkzeug.exceptions import abort
  File "/Users/robinho/financeiro/server/lib/werkzeug/__init__.py", line 20, in <module>
    from werkzeug._compat import iteritems
  File "/Users/robinho/financeiro/server/lib/werkzeug/werkzeug/__init__.py", line 154, in <module>
    __import__('werkzeug.exceptions')
  File "/Users/robinho/financeiro/server/lib/werkzeug/werkzeug/exceptions.py", line 71, in <module>
    from werkzeug.wrappers import Response
  File "/Users/robinho/financeiro/server/lib/werkzeug/werkzeug/wrappers.py", line 26, in <module>
    from werkzeug.http import HTTP_STATUS_CODES, \
  File "/Users/robinho/financeiro/server/lib/werkzeug/werkzeug/http.py", line 971, in <module>
    from werkzeug.datastructures import Accept, HeaderSet, ETags, Authorization, \
  File "/Users/robinho/financeiro/server/lib/werkzeug/werkzeug/datastructures.py", line 2612, in <module>
    from werkzeug import exceptions
ImportError: cannot import name exceptions
INFO     2014-01-18 12:22:26,142 module.py:612] default: "GET /favicon.ico HTTP/1.1" 500 -
@henriquez
Copy link
Contributor

It looks like you installed flask/werkzeug twice into that project, which in turn is causing import issues. For example, in my project, the server/lib/werkzeug directory does not contain a subdirectory called werkzeug. So you need to delete the duplicate directories, or perhaps just download the project again and this time don't run pip install, because when you download the project from developers.google.com/appengine, it already has the dependencies pre-installed.

@foxbunny
Copy link

FYI, if you install with pip install werkzeug --target /server/lib it will place the werkzeug package in /server/lib/werkzeug/werkzeug and cause this import error.

EDIT: After fiddling with various options, I decided to kill the directory where I was installing my deps (not using this skeleton but some other project), and after reinstalling the dependencies, it just worked... Weird.

@proppy
Copy link
Contributor

proppy commented Feb 18, 2014

@foxbunny the instructions should states pip install --target lib now, closing this issue.

proppy@noir:/tmp$ pip install -t lib werkzeug
Downloading/unpacking werkzeug
  Downloading Werkzeug-0.9.4.tar.gz (1.1MB): 1.1MB downloaded
  Running setup.py (path:/tmp/pip_build_proppy/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'
Installing collected packages: werkzeug
  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'
Successfully installed werkzeug
Cleaning up...
proppy@noir:/tmp$ ls lib
werkzeug  Werkzeug-0.9.4.egg-info
proppy@noir:/tmp$ ls lib/werkzeug/
_compat.py         datastructures.pyc  formparser.py   __init__.py    local.py            routing.py   security.py   testapp.py   testsuite      useragents.pyc  wrappers.pyc
_compat.pyc        debug               formparser.pyc  __init__.pyc   local.pyc           routing.pyc  security.pyc  testapp.pyc  urls.py        utils.py        wsgi.py
contrib            exceptions.py       http.py         _internal.py   posixemulation.py   script.py    serving.py    test.py      urls.pyc       utils.pyc       wsgi.pyc
datastructures.py  exceptions.pyc      http.pyc        _internal.pyc  posixemulation.pyc  script.pyc   serving.pyc   test.pyc     useragents.py  wrappers.py

@proppy proppy closed this as completed Feb 18, 2014
@foxbunny
Copy link

Ok, so after having to deal with this issues many times over, here's my conclusion. The install will only succeed the first time (i.e., when target directory where you install deps is empty). If werkzeug is already in that directory, the install will fail (regardless of what pip command you used). This is probably a pip issue. Just leaving this note here in case someone finds this looking for the same exception. So the cure is to remove the werkzeug directory manually before installing again.

@mallyvai
Copy link

@foxbunny - Thanks! This post helped. The "pip install requirements.txt -t lib/" command is not idempotent in this context. Seems like a bug. Doing it exactly once does the trick.

@gamunax
Copy link

gamunax commented Jul 9, 2014

Solution:
Search the archive files:

  • Convention.py change the text zen tekton
  • Change settings.py Zen text by tekton
  • Zen home.py change the text by tekton

@gbitten
Copy link

gbitten commented Dec 9, 2014

I got the same problem when I installed Flask-KVSession because werkzeug is one of its dependencies. So, I used "--no-deps" option in pip.

pip install --no-deps -t lib Flask-KVSession

@tianhuil
Copy link

I got the same issue and it turned out to be resolved by flask versioning. For me, Flask==0.10 was the offending culprit and this issue seemed to have been fixed by Flask==0.10.1. Hope that helps!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants