TurboGears 2 quick launch shows error

I am new to TurboGears and have just installed TG2 in a virtual environment. I follow the quick start guide and successfully created helloworld via

paster quickstart 

I started the server and switched to a web browser on localhost: 8080

Don't you know this, I immediately get an error message, not a welcome message that the documentation that I should see offers.

Error:

 AttributeError: 'AcceptLanguage' object has no attribute 'best_matches' 

Here's the trace:

 URL: http://localhost:8080/ File 'C:\\VirtualEnv_1\\lib\\site-packages\\weberror-0.10.3-py2.7.egg\\weberror\\evalexception.py', line 431 in respond app_iter = self.application(environ, detect_start_response) File 'C:\\VirtualEnv_1\\lib\\site-packages\\beaker-1.6-py2.7.egg\\beaker\\middleware.py', line 73 in __call__ return self.app(environ, start_response) File 'C:\\VirtualEnv_1\\lib\\site-packages\\beaker-1.6-py2.7.egg\\beaker\\middleware.py', line 155 in __call__ return self.wrap_app(environ, session_start_response) File 'C:\\VirtualEnv_1\\lib\\site-packages\\routes-1.12.3-py2.7.egg\\routes\\middleware.py', line 131 in __call__ response = self.app(environ, start_response) File 'C:\\VirtualEnv_1\\lib\\site-packages\\pylons-1.0-py2.7.egg\\pylons\\wsgiapp.py', line 107 in __call__ response = self.dispatch(controller, environ, start_response) File 'C:\\VirtualEnv_1\\lib\\site-packages\\pylons-1.0-py2.7.egg\\pylons\\wsgiapp.py', line 312 in dispatch return controller(environ, start_response) File 'C:\\VirtualEnv_1\\Scripts\\HelloWorld\\helloworld\\lib\\base.py', line 27 in __call__ return TGController.__call__(self, environ, start_response) File 'C:\\VirtualEnv_1\\lib\\site-packages\\pylons-1.0-py2.7.egg\\pylons\\controllers\\core.py', line 211 in __call__ response = self._dispatch_call() File 'C:\\VirtualEnv_1\\lib\\site-packages\\pylons-1.0-py2.7.egg\\pylons\\controllers\\core.py', line 162 in _dispatch_call response = self._inspect_call(func) File 'C:\\VirtualEnv_1\\lib\\site-packages\\pylons-1.0-py2.7.egg\\pylons\\controllers\\core.py', line 105 in _inspect_call result = self._perform_call(func, args) File 'C:\\VirtualEnv_1\\lib\\site-packages\\turbogears2-2.1.3-py2.7.egg\\tg\\controllers\\dispatcher.py', line 230 in _perform_call setup_i18n() File 'C:\\VirtualEnv_1\\lib\\site-packages\\turbogears2-2.1.3-py2.7.egg\\tg\\i18n.py', line 61 in setup_i18n 

pylons.request.accept_language.best_matches ())) AttributeError: the AcceptLanguage object does not have the best_matches attribute

Did I mess up when I installed it, or is it a problem with TurboGears?

Edit: I created a second project, which I called GoodnightMoon, this time without the Mako template option (which is the only difference between the settings), and I get the same error:

 'AcceptLanguage' object has no attribute 'best_matches' 

Unfortunately, this question is the only one that I can find using a web search related to this particular error.

Are there any other tips I can use and provide stackoverflow to help answer this question?

Following Michael Pederson's advice below, I explored the i18n. I have an i18n directory with one subdirectory called ru (in Russian, I suppose). I work on systems and browsers in English.

I use what the most current TG2 distribution at the time of this question, v. 2.1.3 and tg.devtools 2.1.x

+4
source share
1 answer

The problem is an incorrect dependency on WebOb. Installed IIRC 1.2b2, which does not have the best_matches method in the AcceptLanguage class. The easiest way to overcome this problem is to replace WebOb-1.2b2 with stable WebOb-1.1.1. This solution is great for me.

PS: if you use virtual-env - just replace the files inside lib / python2.7 / site-packages / webob with the files from the official site http://pypi.python.org/pypi/WebOb/1.1.1

+4
source

All Articles