CKAN 页面扩展中的 PluginNotFoundException

0 投票
1 回答
705 浏览
提问于 2025-04-17 20:57

我正在使用CKAN作为我的开放数据门户。CKAN是用Python编写的,使用的是Pylons框架。我想要集成一个叫做ckanext-pages的插件。所以我按照下面的步骤操作。

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

但是我还是遇到了下面的错误。尽管我已经尝试重启CKAN和Apache服务器。

ckan.plugins.core.PluginNotFoundException: pages

当我运行python setup.py develop这个命令时,它还是显示这个插件安装得很正确。请看下面的输出。

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

尽管它说插件安装得很好,但还是出现了错误。我该怎么解决这个问题呢?

1 个回答

2

你已经把软件包安装到了系统的Python里(/usr/local/lib/python2.7/dist-packages)。确保你使用的是虚拟环境里的pip和python。看起来你的虚拟环境根本没有被激活。试着执行一下 source /usr/lib/ckan/default/bin/activate 来激活它。你也可以尝试用虚拟环境的绝对路径来调用pip和python。

撰写回答