문제

I am getting the following error when I am trying to debug an extension that I have created. I am very new to CKAN. I am trying to learn how to develop CKAN extension.

It seems like the "repoze" module is not getting loaded. Is this a python path issue? Where this module suppose to exist?

File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1815, in declare_namespace
   path = sys.modules[parent].__path__
KeyError: 'repoze'
도움이 되었습니까?

해결책

To develop an extension you need to have done a source install of CKAN. Assuming you've done that, you'll have put the Repoze python module into a Python virtual environment:

{pyenv}/lib/python2.7/site-packages/repoze

For Python to find Repoze etc., you need to 'activate' this environment. The CKAN source install instructions describe all this, but here are the relevant bits, using the suggested environment location /usr/lib/ckan/default.

For a command-line program:

. /usr/lib/ckan/default/bin/activate

Or for a python program run it using this executable:

/usr/lib/ckan/default/bin/python

Or for an apache deployment the environment is specified in is this part of WSGI script file:

activate_this = os.path.join('/usr/lib/ckan/default/bin/activate_this.py')
execfile(activate_this, dict(__file__=activate_this))
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top