简体   繁体   English

CKAN安装:贴纸错误

[英]CKAN Install: paster error

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

I've created and activated the python virtualenv and now need to create a CKAN config file: 我创建并激活了python virtualenv,现在需要创建一个CKAN配置文件:

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

The output is as follows (ImportError at the last line): 输出如下(最后一行的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

I'm not sure how to proceed, any ideas? 我不确定如何继续,任何想法?

ImportError: No module named pylons.util looks like Python cannot find the Pylons package, one of the Python packages that CKAN depends on. ImportError: No module named pylons.util看起来像Python找不到Pylons包,这是CKAN所依赖的Python包之一。 Two possibilities come to mind: 我想到了两种可能性:

  1. Did you activate your CKAN virtualenv, before running the paster command? 在运行paster命令之前,您是否激活了CKAN virtualenv? ~/ckan/default/bin/activate . ~/ckan/default/bin/activate

  2. Have you installed the Python packages that CKAN depends on into your virtualenv? 您是否已将CKAN所依赖的Python软件包安装到您的virtualenv中? With the virtualenv activated run pip install -r ~/ckan/default/src/ckan/requirements.txt 使用virtualenv激活run pip install -r ~/ckan/default/src/ckan/requirements.txt

If you activate your CKAN virtual environment and then run pip freeze | grep pylons 如果激活CKAN虚拟环境然后运行pip freeze | grep pylons pip freeze | grep pylons , this should tell you whether pylons is installed in the virtualenv. pip freeze | grep pylons ,这应该告诉你是否在virtualenv中安装了pylons。

The Distribution already installed: at the top of your terminal output is strange. Distribution already installed:在终端输出的顶部是奇怪的。

I had the same error and a slightly different solution: 我有同样的错误和一个稍微不同的解决方案:

  1. got the error only after using sudo , so I went out of it ( sudo -k ) 使用sudo之后才得到错误,所以我走了它( sudo -k
  2. then I got the following error: IOError: [Errno 13] Permission denied: '/etc/ckan/default/development.ini' 然后我收到以下错误: IOError: [Errno 13] Permission denied: '/etc/ckan/default/development.ini'
  3. after digging around a lot, I finally found out that while the /etc/ckan had correct permissions, it was actually a symlink to ~/ckan/etc and that folder did not have correct permissions 经过深入挖掘后,我终于发现,虽然/ etc / ckan具有正确的权限,但它实际上是~/ckan/etc的符号链接,并且该文件夹没有正确的权限
  4. I ran sudo chown -R `whoami` ~/ckan/etc and followed up with paster make-config ckan /etc/ckan/default/development.ini 我跑了sudo chown -R `whoami` ~/ckan/etc并跟进了paster make-config ckan /etc/ckan/default/development.ini

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM