CKAN安装:贴纸错误

时间:2014-02-22 13:53:51

标签: python ckan paster

基于http://docs.ckan.org/en/latest/maintaining/installing/install-from-source.html在OSX 10.9上本地安装CKAN。

我已经创建并激活了python virtualenv,现在需要创建一个CKAN配置文件:

$ paster make-config ckan /etc/ckan/default/development.ini

输出如下(最后一行的ImportError):

Distribution already installed:
      ckan 2.2 from ~/ckan/lib/default/src/ckan
    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/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/lib/python2.7/site-packages/paste/script/command.py", line 143, in invoke
        exit_code = runner.run(args)
      File "/usr/lib/ckan/default/lib/python2.7/site-packages/paste/script/appinstall.py", line 68, in run
        return super(AbstractInstallCommand, self).run(new_args)
      File "/usr/lib/ckan/default/lib/python2.7/site-packages/paste/script/command.py", line 238, in run
        result = self.command()
      File "/usr/lib/ckan/default/lib/python2.7/site-packages/paste/script/appinstall.py", line 295, in command
        self.distro, self.options.ep_group, self.options.ep_name)
      File "/usr/lib/ckan/default/lib/python2.7/site-packages/paste/script/appinstall.py", line 234, in get_installer
        'paste.app_install', ep_name)
      File "/usr/lib/ckan/default/lib/python2.7/site-packages/pkg_resources.py", line 2302, in load_entry_point
        return ep.load()
      File "/usr/lib/ckan/default/lib/python2.7/site-packages/pkg_resources.py", line 2029, in load
        entry = __import__(self.module_name, globals(),globals(), ['__name__'])
      File "~/ckan/lib/default/src/ckan/ckan/config/install.py", line 3, in <module>
        from pylons.util import PylonsInstaller
    ImportError: No module named pylons.util

我不确定如何继续,任何想法?

2 个答案:

答案 0 :(得分:10)

ImportError: No module named pylons.util看起来Python无法找到Pylons包,它是CKAN所依赖的Python包之一。我想到了两种可能性:

  1. 在运行paster命令之前,您是否激活了CKAN virtualenv? ~/ckan/default/bin/activate

  2. 您是否已将CKAN所依赖的Python软件包安装到您的virtualenv中?随着virtualenv激活了运行pip install -r ~/ckan/default/src/ckan/requirements.txt

  3. 如果您激活CKAN虚拟环境然后运行pip freeze | grep pylons,这应该告诉您是否在virtualenv中安装了pylons。

    终端输出顶部的Distribution already installed:很奇怪。

答案 1 :(得分:2)

我遇到了同样的错误和一个稍微不同的解决方案:

  1. 仅在使用sudo后才出错,所以我离开了它(sudo -k
  2. 然后我收到以下错误:IOError: [Errno 13] Permission denied: '/etc/ckan/default/development.ini'
  3. 经过深入挖掘后,我终于发现,虽然/ etc / ckan具有正确的权限,但它实际上是~/ckan/etc的符号链接,并且该文件夹没有正确的权限
  4. 我跑了sudo chown -R `whoami` ~/ckan/etc并跟进paster make-config ckan /etc/ckan/default/development.ini