问题
I'm using CKAN as my open data portal and am trying to install the Archiver Extension by following the instructions at https://github.com/ckan/ckanext-archiver. However I am faced with this error which I could not solve after enabling the archiver in my ckan config file.
Traceback (most recent call last):
File "/usr/lib/ckan/default/bin/paster", line 9, in <module>
load_entry_point('PasteScript==1.7.5', 'console_scripts', 'paster')()
File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/script/command.py", line 104, in run
invoke(command, command_name, options, args[1:])
File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/script/command.py", line 143, in invoke
exit_code = runner.run(args)
File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/script/command.py", line 238, in run
result = self.command()
File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/script/serve.py", line 284, in command
relative_to=base, global_conf=vars)
File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/script/serve.py", line 321, in loadapp
**kw)
File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 247, in loadapp
return loadobj(APP, uri, name=name, **kw)
File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 272, in loadobj
return context.create()
File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 710, in create
return self.object_type.invoke(self)
File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 146, in invoke
return fix_call(context.object, context.global_conf, **context.local_conf)
File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/deploy/util.py", line 56, in fix_call
val = callable(*args, **kw)
File "/usr/lib/ckan/default/src/ckan/ckan/config/middleware.py", line 57, in make_app
load_environment(conf, app_conf)
File "/usr/lib/ckan/default/src/ckan/ckan/config/environment.py", line 232, in load_environment
p.load_all(config)
File "/usr/lib/ckan/default/src/ckan/ckan/plugins/core.py", line 134, in load_all
load(*plugins)
File "/usr/lib/ckan/default/src/ckan/ckan/plugins/core.py", line 149, in load
service = _get_service(plugin)
File "/usr/lib/ckan/default/src/ckan/ckan/plugins/core.py", line 255, in _get_service
return plugin.load()(name=plugin_name)
File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/pkg_resources.py", line 2147, in load
['__name__'])
File "/usr/lib/ckan/default/src/ckanext-archiver/ckanext/archiver/plugin.py", line 10, in <module>
from ckan.lib.celery_app import celery
File "/usr/lib/ckan/default/src/ckan/ckan/lib/celery_app.py", line 12, in <module>
from celery import Celery
ImportError: No module named celery
I have installed the extension from an activated virtualenv and the required libraries.
sudo pip install -e git+http://github.com/okfn/ckanext-archiver.git#egg=ckanext-archiver
Obtaining ckanext-archiver from git+http://github.com/okfn/ckanext-archiver.git#egg=ckanext-archiver
Updating ./src/ckanext-archiver clone
Running setup.py egg_info for package ckanext-archiver
Installing collected packages: ckanext-archiver
Running setup.py develop for ckanext-archiver
Checking .pth file support in /usr/local/lib/python2.7/dist-packages/
/usr/bin/python -E -c pass
TEST PASSED: /usr/local/lib/python2.7/dist-packages/ appears to support .pth files
Creating /usr/local/lib/python2.7/dist-packages/ckanext-archiver.egg-link (link to .)
ckanext-archiver 0.1 is already the active version in easy-install.pth
Installed /home/kean/src/ckanext-archiver
Successfully installed ckanext-archiver
sudo pip install requirements.txtDownloading/unpacking requirements.txt
Real name of requirement requirements.txt is requirements.txt
Could not find any downloads that satisfy the requirement requirements.txt
No distributions at all found for requirements.txt
Storing complete log in /home/kean/.pip/pip.log
Appreciate if anyone knows how to fix this. Thanks.
回答1:
Do not call sudo pip install
when you are using virtualenv, just pip install
.
I had some issues executing:
pip install -e git://github.com/okfn/ckanext-archiver.git#egg=ckanext-archiver
which resulted with
no matches found: git://github.com/okfn/ckanext-archiver.git#egg=ckanext-archiver
but below commands worked just fine:
cd /tmp/
git clone git://github.com/okfn/ckanext-archiver.git
pip install -e ./ckanext-archiver
pip install -r ckanext-archiver/pip-requirements.txt
来源:https://stackoverflow.com/questions/24113057/no-module-named-celery-when-installing-ckanext-archiver