Error when creating Database Tables - CKAN - python

i'm trying to install CKAN 2.5.2 on Centos 6.8
When i run paster db init -c /etc/ckan/default/development.ini
i get error
Traceback (most recent call last):
File "/usr/lib/ckan/default/bin/paster", line 9, in <module>
load_entry_point('PasteScript==2.0.2', 'console_scripts', 'paster')()
File "/usr/lib/ckan/default/lib/python2.6/site-packages/paste/script/command.py", line 102, in run
invoke(command, command_name, options, args[1:])
File "/usr/lib/ckan/default/lib/python2.6/site-packages/paste/script/command.py", line 141, in invoke
exit_code = runner.run(args)
File "/usr/lib/ckan/default/lib/python2.6/site-packages/paste/script/command.py", line 236, in run
result = self.command()
File "/usr/lib/ckan/default/src/ckan/ckan/lib/cli.py", line 205, in command
self._load_config(cmd!='upgrade')
File "/usr/lib/ckan/default/src/ckan/ckan/lib/cli.py", line 142, in _load_config
conf = self._get_config()
File "/usr/lib/ckan/default/src/ckan/ckan/lib/cli.py", line 139, in _get_config
return appconfig('config:' + self.filename)
File "/usr/lib/ckan/default/lib/python2.6/site-packages/paste/deploy/loadwsgi.py", line 261, in appconfig
global_conf=global_conf)
File "/usr/lib/ckan/default/lib/python2.6/site-packages/paste/deploy/loadwsgi.py", line 296, in loadcontext
global_conf=global_conf)
File "/usr/lib/ckan/default/lib/python2.6/site-packages/paste/deploy/loadwsgi.py", line 320, in _loadconfig
return loader.get_context(object_type, name, global_conf)
File "/usr/lib/ckan/default/lib/python2.6/site-packages/paste/deploy/loadwsgi.py", line 454, in get_context
section)
File "/usr/lib/ckan/default/lib/python2.6/site-packages/paste/deploy/loadwsgi.py", line 476, in _context_from_use
object_type, name=use, global_conf=global_conf)
File "/usr/lib/ckan/default/lib/python2.6/site-packages/paste/deploy/loadwsgi.py", line 406, in get_context
global_conf=global_conf)
File "/usr/lib/ckan/default/lib/python2.6/site-packages/paste/deploy/loadwsgi.py", line 296, in loadcontext
global_conf=global_conf)
File "/usr/lib/ckan/default/lib/python2.6/site-packages/paste/deploy/loadwsgi.py", line 328, in _loadegg
return loader.get_context(object_type, name, global_conf)
File "/usr/lib/ckan/default/lib/python2.6/site-packages/paste/deploy/loadwsgi.py", line 620, in get_context
object_type, name=name)
File "/usr/lib/ckan/default/lib/python2.6/site-packages/paste/deploy/loadwsgi.py", line 646, in find_egg_entry_point
possible.append((entry.load(), protocol, entry.name))
File "/usr/lib/ckan/default/lib/python2.6/site-packages/pkg_resources/__init__.py", line 2229, in load
return self.resolve()
File "/usr/lib/ckan/default/lib/python2.6/site-packages/pkg_resources/__init__.py", line 2235, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/usr/lib/ckan/default/src/ckan/ckan/config/middleware.py", line 28, in <module>
from ckan.config.environment import load_environment
File "/usr/lib/ckan/default/src/ckan/ckan/config/environment.py", line 18, in <module>
import ckan.lib.helpers as h
File "/usr/lib/ckan/default/src/ckan/ckan/lib/helpers.py", line 30, in <module>
from bleach import clean as clean_html
File "/usr/lib/ckan/default/lib/python2.6/site-packages/bleach/__init__.py", line 8, in <module>
from html5lib.sanitizer import HTMLSanitizer
ImportError: No module named sanitizer
I was following wiki instructions
I'm stuck on this step and don't know how to proceed.
Module html5lib is imported and updated to latest version. Paster script is executed in virtualenv under root account.
Also i'm running all of this in python2.6 since that is default on Centos.
Some additional information
when i run python and import html5lib and then help(html5lib) i get this
>>> import html5lib
>>> help(html5lib)
Help on package html5lib:
NAME
html5lib
FILE
/usr/lib/python2.6/site-packages/html5lib/__init__.py
DESCRIPTION
HTML parsing library based on the WHATWG "HTML5"
specification. The parser is designed to be compatible with existing
HTML found in the wild and implements well-defined error recovery that
is largely compatible with modern desktop web browsers.
Example usage:
import html5lib
f = open("my_document.html")
tree = html5lib.parse(f)
PACKAGE CONTENTS
_ihatexml
_inputstream
_tokenizer
_trie (package)
_utils
constants
filters (package)
html5parser
serializer
treeadapters (package)
treebuilders (package)
treewalkers (package)
CLASSES
__builtin__.object
html5lib.html5parser.HTMLParser
class HTMLParser(__builtin__.object)
| HTML parser. Generates a tree structure from a stream of (possibly
| malformed) HTML
|
| Methods defined here:
:
There is no sanitizer here. Do i need to use specific version of html5lib?
Can anyone help?

It looks like you have 2 copies of html5lib installed. When you did help(html5lib) it is showing a copy that is installed in your user's python directory (/usr/lib/python2.6/site-packages/) not the virtualenv that you have ckan (and bleach) installed (/usr/lib/ckan/default/lib/python2.6/site-packages/). So get rid of the former to avoid confusion.
Yes I think you have the wrong version of html5lib, since sanitizer is listed in the package contents when I do help.
This is the correct version (at the time of writing - in future check what is in requirements.txt):
$ pip freeze | grep html5lib
html5lib==0.9999999

Related

BeautifulSoup4 in Sagemath

I'm trying to perform web scraping with BS4 and then do some algebra work with the results in Sage 6.2 (in Lion 10.7.5). I assumed that /Applications/Sage-6.2.app/Contents/Resources/sage/sage -i beautifulsoup4 would work, but the result is
Attempting to download package beautifulsoup4
>>> Checking online list of optional packages.
[Traceback (most recent call last):
File "<stdin>", line 35, in <module>
File "/Applications/Sage-6.2.app/Contents/Resources/sage/local/lib/python/urllib.py", line 240, in retrieve
fp = self.open(url, data)
File "/Applications/Sage-6.2.app/Contents/Resources/sage/local/lib/python/urllib.py", line 208, in open
return getattr(self, name)(url)
File "/Applications/Sage-6.2.app/Contents/Resources/sage/local/lib/python/urllib.py", line 359, in open_http
return self.http_error(url, fp, errcode, errmsg, headers)
File "/Applications/Sage-6.2.app/Contents/Resources/sage/local/lib/python/urllib.py", line 376, in http_error
return self.http_error_default(url, fp, errcode, errmsg, headers)
File "<stdin>", line 17, in http_error_default
IOError: [Errno 404] Not Found: '//www.sagemath.org/spkg/optional/list'
Error: failed to download http://www.sagemath.org/spkg/optional/list, aborting
Next, I tried /Applications/Sage-6.2.app/Contents/Resources/sage/sage -sh <<< "easy_install --verbose pip" to get bs4 via pip. That succeeded; however /Applications/Sage-6.2.app/Contents/Resources/sage/local/bin/pip2.7 install beautifulsoup4 failed with error message
Traceback (most recent call last):
File "/Applications/Sage-6.2.app/Contents/Resources/sage/local/lib/python2.7/site.py", line 548, in <module>
main()
File "/Applications/Sage-6.2.app/Contents/Resources/sage/local/lib/python2.7/site.py", line 530, in main
known_paths = addusersitepackages(known_paths)
File "/Applications/Sage-6.2.app/Contents/Resources/sage/local/lib/python2.7/site.py", line 266, in addusersitepackages
user_site = getusersitepackages()
File "/Applications/Sage-6.2.app/Contents/Resources/sage/local/lib/python2.7/site.py", line 241, in getusersitepackages
user_base = getuserbase() # this will also set USER_BASE
File "/Applications/Sage-6.2.app/Contents/Resources/sage/local/lib/python2.7/site.py", line 231, in getuserbase
USER_BASE = get_config_var('userbase')
File "/Applications/Sage-6.2.app/Contents/Resources/sage/local/lib/python2.7/sysconfig.py", line 516, in get_config_var
return get_config_vars().get(name)
File "/Applications/Sage-6.2.app/Contents/Resources/sage/local/lib/python2.7/sysconfig.py", line 449, in get_config_vars
import re
File "/Applications/Sage-6.2.app/Contents/Resources/sage/local/lib/python2.7/re.py", line 105, in <module>
import sre_compile
File "/Applications/Sage-6.2.app/Contents/Resources/sage/local/lib/python2.7/sre_compile.py", line 14, in <module>
import sre_parse
File "/Applications/Sage-6.2.app/Contents/Resources/sage/local/lib/python2.7/sre_parse.py", line 17, in <module>
from sre_constants import *
File "/Applications/Sage-6.2.app/Contents/Resources/sage/local/lib/python2.7/sre_constants.py", line 18, in <module>
from _sre import MAXREPEAT
ImportError: cannot import name MAXREPEAT
Next, I tried upgrading to Sage 6.6. That went smoothly, as did the installation of bs4. However, when I opened the notebook, I was unable to run code cells, because the "Shift-Enter" command only registered as "Enter" and gave me a new line instead of evaluating the code. Additionally, there was no "evaluate" button. Any recommendations to solve any of these issues would be greatly appreciated.
Unfortunately, Sage has changed how it handles optional packages like BS so that older versions may not be able to use them. You can always go to a mirror, though, like http://mirrors.mit.edu/sage/spkg/optional/ download it, and put it in your (old Sage's) optional spkg directory and try doing sage -i path/to/file.
As to the notebook issue, that should be a matter of doing a "hard cache reset" in the browser due to different jQuery versions, see e.g. here.

Installing pymongo on a nitrous.io box

I'm fairly new to Python, and Nitrous.IO, and MongoDB, and command line in general so would appreciate a little guidance here if possible.
I'm trying to install pymongo on my Nitrous.IO box but can't seem to find a way to do it - this tutorial suggests 'import pymongo' but that didn't work (see below).
I can't seem to find any tutorials or help on this - a google search for "install +pymongo with nitrous.io" gave me 0 results.
action#thirdyearproject-148753:~(master*)$ import pymongo
import: unable to open X server `' # error/import.c/ImportImageCommand/366.
action#thirdyearproject-148753:~(master*)$ pip install pymongo
Traceback (most recent call last):
File "/home/action/.parts/bin/pip", line 9, in <module>
load_entry_point('pip==1.5.4', 'console_scripts', 'pip')()
File "/home/action/.parts/packages/python2/2.7.6/lib/python2.7/site-packages/pkg_resources.py", line 356, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/home/action/.parts/packages/python2/2.7.6/lib/python2.7/site-packages/pkg_resources.py", line 2431, in load_entry_point
return ep.load()
File "/home/action/.parts/packages/python2/2.7.6/lib/python2.7/site-packages/pkg_resources.py", line 2147, in load
['__name__'])
File "/home/action/.parts/packages/python2/2.7.6/lib/python2.7/site-packages/pip-1.5.4-py2.7.egg/pip/__init__.py", line 10, in <modul
from pip.util import get_installed_distributions, get_prog
File "/home/action/.parts/packages/python2/2.7.6/lib/python2.7/site-packages/pip-1.5.4-py2.7.egg/pip/util.py", line 15, in <module>
from pip.locations import site_packages, running_under_virtualenv, virtualenv_no_global
File "/home/action/.parts/packages/python2/2.7.6/lib/python2.7/site-packages/pip-1.5.4-py2.7.egg/pip/locations.py", line 96, in <modu
build_prefix = _get_build_prefix()
File "/home/action/.parts/packages/python2/2.7.6/lib/python2.7/site-packages/pip-1.5.4-py2.7.egg/pip/locations.py", line 64, in _get_
path = os.path.join(tempfile.gettempdir(), 'pip_build_%s' %
File "/home/action/.parts/packages/python2/2.7.6/lib/python2.7/tempfile.py", line 269, in gettempdir
tempdir = _get_default_tempdir()
File "/home/action/.parts/packages/python2/2.7.6/lib/python2.7/tempfile.py", line 212, in _get_default_tempdir
("No usable temporary directory found in %s" % dirlist))
IOError: [Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/home/action']
action#thirdyearproject-148753:~(master*)$ easy_install pymongo
Traceback (most recent call last):
File "/home/action/.parts/bin/easy_install", line 5, in <module>
from pkg_resources import load_entry_point
File "/home/action/.parts/packages/python2/2.7.6/lib/python2.7/site-packages/pkg_resources.py", line 2829, in <module>
working_set = WorkingSet._build_master()
File "/home/action/.parts/packages/python2/2.7.6/lib/python2.7/site-packages/pkg_resources.py", line 451, in _build_master
return cls._build_from_requirements(__requires__)
File "/home/action/.parts/packages/python2/2.7.6/lib/python2.7/site-packages/pkg_resources.py", line 464, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/home/action/.parts/packages/python2/2.7.6/lib/python2.7/site-packages/pkg_resources.py", line 639, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: setuptools==2.2
action#thirdyearproject-148753:~(master*)$ parts install pymongo
parts: ERROR: Package "pymongo" not found
Aborting!
Does anyone know how I would go about installing this? It's starting to be a real pain!
You might be able to install it withpip using this advice. Once you've done that, you would use the import pymongo at the top of your code file.

"ImportError: No module named pwd" but it exists

I'm trying to test gae-boilerplate locally, but when I try to create a new account the following error appears.
The strange thing is that if I open python interpreter and type "import pwd" it works.
Internal Server Error
The server has either erred or is incapable of performing the requested operation.
Traceback (most recent call last): File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2-2.5.2/webapp2.py", line 1535, in __call__
rv = self.handle_exception(request, response, e) File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2-2.5.2/webapp2.py", line 1529, in __call__
rv = self.router.dispatch(request, response) File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2-2.5.2/webapp2.py", line 1278, in default_dispatcher
return route.handler_adapter(request, response) File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2-2.5.2/webapp2.py", line 1102, in __call__
return handler.dispatch() File "/Users/moisesguimaraes/workspaces/python/mtgtradelist/boilerplate/lib/basehandler.py", line 88, in dispatch
webapp2.RequestHandler.dispatch(self) File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2-2.5.2/webapp2.py", line 572, in dispatch
return self.handle_exception(e, self.app.debug) File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2-2.5.2/webapp2.py", line 570, in dispatch
return method(*args, **kwargs) File "/Users/moisesguimaraes/workspaces/python/mtgtradelist/boilerplate/handlers.py", line 766, in post
password = utils.hashing(password, self.app.config.get('salt')) File "/Users/moisesguimaraes/workspaces/python/mtgtradelist/boilerplate/lib/utils.py", line 38, in hashing
from Crypto.Cipher import AES File "/Library/Python/2.7/site-packages/pycrypto-2.6-py2.7-macosx-10.8-intel.egg/Crypto/Cipher/AES.py", line 50, in <module> File "/Library/Python/2.7/site-packages/pycrypto-2.6-py2.7-macosx-10.8-intel.egg/Crypto/Cipher/_AES.py", line 7, in <module> File "/Library/Python/2.7/site-packages/pycrypto-2.6-py2.7-macosx-10.8-intel.egg/Crypto/Cipher/_AES.py", line 4, in __bootstrap__ File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/setuptools-0.6c11/pkg_resources.py", line 882, in resource_filename
self, resource_name File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/setuptools-0.6c11/pkg_resources.py", line 1351, in get_resource_filename
self._extract_resource(manager, self._eager_to_zip(name)) File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/setuptools-0.6c11/pkg_resources.py", line 1373, in _extract_resource
self.egg_name, self._parts(zip_path) File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/setuptools-0.6c11/pkg_resources.py", line 957, in get_cache_path
extract_path = self.extraction_path or get_default_cache() File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/setuptools-0.6c11/pkg_resources.py", line 1080, in get_default_cache
return os.path.expanduser('~/.python-eggs') File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/posixpath.py", line 259, in expanduser
import pwd File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/python/sandbox.py", line 835, in load_module
raise ImportError('No module named %s' % fullname) ImportError: No module named pwd
I believe this problem was introduced by an AppEngine SDK update. I'm currently using version 1.8.6. The gae-boilerplate README states that its been "Tested with SDK version 1.8.1"
I was able to run it locally by running old_dev_appserver.py <application root> old_dev_appserver.py is provided by the SDK and is located in the same directory as dev_appserver.py.
Based on the traceback I got, it looks like the file boilerplate/external/requests/utils.py imports netrc which imports pwd.
The newer version of the SDK doesn't allow you to import the pwd module in its sandbox mode.
You probably installed pycrypto with easy_install. If you reinstalling it with pip instead, everything should work:
pip uninstall pycrypto
pip install pycrypto
Note, pip uninstall works even though it was installed with easy_install. You also might need to use sudo.
If you don't have pip, install it like this:
sudo easy_install pip

Django/Celery can't find importlib

So I just updated django to 1.2.3 and now when I try to run 'python manage.py shell' to work in the django environment, I'm getting the following error.
Traceback (most recent call last):
File "manage.py", line 11, in <module>
execute_manager(settings)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/core/management/__init__.py", line 438, in execute_manager
utility.execute()
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/core/management/__init__.py", line 379, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/core/management/base.py", line 191, in run_from_argv
self.execute(*args, **options.__dict__)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/core/management/base.py", line 220, in execute
output = self.handle(*args, **options)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/core/management/base.py", line 351, in handle
return self.handle_noargs(**options)
File "/opt/local/lib/python2.5/site-packages/django/core/management/commands/shell.py", line 18, in handle_noargs
loaded_models = get_models()
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/db/models/loading.py", line 167, in get_models
self._populate()
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/db/models/loading.py", line 64, in _populate
self.load_app(app_name)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/db/models/loading.py", line 78, in load_app
models = import_module('.models', app_name)
File "/opt/local/lib/python2.5/site-packages/django/utils/importlib.py", line 35, in import_module
__import__(name)
File "/opt/local/lib/python2.5/site-packages/django_celery-2.0.3-py2.5.egg/djcelery/models.py", line 7, in <module>
from celery import conf
File "/opt/local/lib/python2.5/site-packages/celery-2.0.3-py2.5.egg/celery/conf.py", line 6, in <module>
from celery import routes
File "/opt/local/lib/python2.5/site-packages/celery-2.0.3-py2.5.egg/celery/routes.py", line 2, in <module>
from celery.utils import instantiate, firstmethod, mpromise
File "/opt/local/lib/python2.5/site-packages/celery-2.0.3-py2.5.egg/celery/utils/__init__.py", line 9, in <module>
import importlib
ImportError: No module named importlib
Any ideas. I can't seem to find what's going on here and for all I can tell I'm running the same versions on my web server and I don't have the same error showing up.
importlib which was added in Python 2.7/3.1, I believe. You can download a port for pyton 2.5 here:
importlib 1.0.1 - Backport of importlib.import_module() from Python 2.7
Also check the setup.cfg for celery near the bottom and make sure all the other requirements are met (toward the bottom of the script).
importlib was added to Python in version 3.1, and then backported to Python 2.7. Third party backports are available on PyPI.
Also note that 'backported to 2.7' doesn't imply that all versions after 2.7 will have importlib. Python 3.0, I believe, does not have importlib.

Error while executing "paster shell example.ini" in reddit.com

Friends!!! I am frustated since last five days working on implementing
reddit.com on a ubuntu 9.10 machine.
Yes, I know that reddit.com has been tested on ubuntu intrepid. But
now i want to install it on U9.10
I have installed postgresql database, created user copied the files,
and installed all the dependencies.
Everything is installed perfectly as described in the document
http://code.reddit.com/wiki/RedditStartToFinishIntrepid
until the line:
$ paster shell example.ini
this line gives me a error and i couldnt figure out where the problem
lies.
Error:
/home/ubuntu/reddit/r2/r2/lib/utils/utils.py:29: DeprecationWarning:
the sha module is deprecated; use the hashlib module instead
import re, datetime, math, random, string, sha, os
/home/ubuntu/reddit/r2/r2/lib/contrib/memcache.py:50:
DeprecationWarning: the md5 module is deprecated; use hashlib instead
from md5 import md5
Traceback (most recent call last):
File "/usr/local/bin/paster", line 8, in <module>
load_entry_point('PasteScript==1.7.3', 'console_scripts', 'paster')
()
File "/usr/local/lib/python2.6/dist-packages/PasteScript-1.7.3-
py2.6.egg/paste/script/command.py", line 84, in run
invoke(command, command_name, options, args[1:])
File "/usr/local/lib/python2.6/dist-packages/PasteScript-1.7.3-
py2.6.egg/paste/script/command.py", line 123, in invoke
exit_code = runner.run(args)
File "/usr/local/lib/python2.6/dist-packages/PasteScript-1.7.3-
py2.6.egg/paste/script/command.py", line 218, in run
result = self.command()
File "/usr/local/lib/python2.6/dist-packages/Pylons-0.9.6.2-
py2.6.egg/pylons/commands.py", line 341, in command
conf = appconfig(config_name, relative_to=here_dir)
File "/usr/local/lib/python2.6/dist-packages/PasteDeploy-1.3.3-
py2.6.egg/paste/deploy/loadwsgi.py", line 215, in appconfig
global_conf=global_conf)
File "/usr/local/lib/python2.6/dist-packages/PasteDeploy-1.3.3-
py2.6.egg/paste/deploy/loadwsgi.py", line 248, in loadcontext
global_conf=global_conf)
File "/usr/local/lib/python2.6/dist-packages/PasteDeploy-1.3.3-
py2.6.egg/paste/deploy/loadwsgi.py", line 278, in _loadconfig
return loader.get_context(object_type, name, global_conf)
File "/usr/local/lib/python2.6/dist-packages/PasteDeploy-1.3.3-
py2.6.egg/paste/deploy/loadwsgi.py", line 409, in get_context
section)
File "/usr/local/lib/python2.6/dist-packages/PasteDeploy-1.3.3-
py2.6.egg/paste/deploy/loadwsgi.py", line 431, in _context_from_use
object_type, name=use, global_conf=global_conf)
File "/usr/local/lib/python2.6/dist-packages/PasteDeploy-1.3.3-
py2.6.egg/paste/deploy/loadwsgi.py", line 361, in get_context
global_conf=global_conf)
File "/usr/local/lib/python2.6/dist-packages/PasteDeploy-1.3.3-
py2.6.egg/paste/deploy/loadwsgi.py", line 248, in loadcontext
global_conf=global_conf)
File "/usr/local/lib/python2.6/dist-packages/PasteDeploy-1.3.3-
py2.6.egg/paste/deploy/loadwsgi.py", line 285, in _loadegg
return loader.get_context(object_type, name, global_conf)
File "/usr/local/lib/python2.6/dist-packages/PasteDeploy-1.3.3-
py2.6.egg/paste/deploy/loadwsgi.py", line 561, in get_context
object_type, name=name)
File "/usr/local/lib/python2.6/dist-packages/PasteDeploy-1.3.3-
py2.6.egg/paste/deploy/loadwsgi.py", line 587, in find_egg_entry_point
possible.append((entry.load(), protocol, entry.name))
File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 1913,
in load
entry = __import__(self.module_name, globals(),globals(),
['__name__'])
File "/home/ubuntu/reddit/r2/r2/__init__.py", line 26, in <module>
from r2.config.middleware import make_app
File "/home/ubuntu/reddit/r2/r2/config/middleware.py", line 30, in
<module>
from pylons.error import error_template
File "/usr/local/lib/python2.6/dist-packages/Pylons-0.9.6.2-
py2.6.egg/pylons/error.py", line 18, in <module>
from pylons.middleware import media_path
File "/usr/local/lib/python2.6/dist-packages/Pylons-0.9.6.2-
py2.6.egg/pylons/middleware.py", line 11, in <module>
from webhelpers.rails.asset_tag import javascript_path
**ImportError: No module named rails.asset_tag**
Kindly guys please help me, take me out of my own frustration.
Thanks in Advance
Newer version of python-webhelpers doesn't have asset_tag.py, you need to install an older version (0.6.4) for Pylons 0.9.6:
wget http://pypi.python.org/packages/source/W/WebHelpers/WebHelpers-0.6.4.tar.gz && tar -xf WebHelpers-0.6.4.tar.gz && cd WebHelpers-0.6.4 && python setup.py build && sudo python setup.py install && cd .. && sudo rm -r WebHelpers-0.6.4*

Categories

Resources