问题
I'm using CKAN as my open data portal. It's written in Python using Pylons framework. I want to integrate ckanext-pages plugin. So I used below steps.
1. . /usr/lib/ckan/default/bin/activate
2. pip install -e 'git+https://github.com/ckan/ckanext-pages.git#egg=ckanext-pages'
3. cd /usr/lib/ckan/default/src/ckanext-pages
4. python setup.py develop
Still I get below exception. Given that I tried restart CKAN and Apache server.
ckan.plugins.core.PluginNotFoundException: pages
But when I run the python setup.py develop command it still that plugin is install correctly. Please see the output below.
running develop
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
running egg_info
writing ckanext_pages.egg-info/PKG-INFO
writing namespace_packages to ckanext_pages.egg-info/namespace_packages.txt
writing top-level names to ckanext_pages.egg-info/top_level.txt
writing dependency_links to ckanext_pages.egg-info/dependency_links.txt
writing entry points to ckanext_pages.egg-info/entry_points.txt
WARNING: ckanext is a namespace package, but its __init__.py does
not declare_namespace(); setuptools 0.7 will REQUIRE this!
(See the setuptools manual under "Namespace Packages" for details.)
reading manifest file 'ckanext_pages.egg-info/SOURCES.txt'
writing manifest file 'ckanext_pages.egg-info/SOURCES.txt'
running build_ext
Creating /usr/local/lib/python2.7/dist-packages/ckanext-pages.egg-link (link to .)
Removing ckanext-pages 0.1 from easy-install.pth file
Adding ckanext-pages 0.1 to easy-install.pth file
Installed /usr/lib/ckan/default/src/ckanext-pages
Processing dependencies for ckanext-pages==0.1
Finished processing dependencies for ckanext-pages==0.1
Even though it says that plugin is installed correctly, exception is occurred. How can I fix this?
回答1:
You have installed the packages into the system Python (/usr/local/lib/python2.7/dist-packages
). Make sure that you use the pip and python from the virtualenv. It seems that the virtualenv is not activated at all. Try executing source /usr/lib/ckan/default/bin/activate
You could also try to call pip and python with the absolute path of the virtualenv.
来源:https://stackoverflow.com/questions/22202185/ckan-pluginnotfoundexception-in-pages-extension