在Plone 4.3.3上发布了“IOError:没有找到egg-info目录”

时间:2014-05-21 10:41:30

标签: plone paster zopeskel

在Plone 4.3.3中使用zopeskel时也会发生错误。这似乎与this question略有不同。在Plone 4.3.2下没有错误。

$ ../bin/paster create plone_basic
Selected and implied templates:
  PasteScript#basic_package  A basic setuptools-enabled package

Variables:
  egg:      plone_basic
  package:  plone_basic
  project:  plone_basic
Enter version (Version (like 0.1)) ['']:
Enter description (One-line description of the package) ['']:
Enter long_description (Multi-line description (in reST)) ['']:
Enter keywords (Space-separated keywords/tags) ['']:
Enter author (Author name) ['']:
Enter author_email (Author email) ['']:
Enter url (URL of homepage) ['']:
Enter license_name (License name) ['']:
Enter zip_safe (True/False: if the package can be distributed as a .zip file) [False]:
Creating template basic_package
Creating directory ./plone_basic
  Recursing into +package+
    Creating ./plone_basic/plone_basic/
    Copying __init__.py to ./plone_basic/plone_basic/__init__.py
  Copying setup.cfg to ./plone_basic/setup.cfg
  Copying setup.py_tmpl to ./plone_basic/setup.py
Running /home/Plone-4.3.3/Python-2.7/bin/python setup.py egg_info
Traceback (most recent call last):
  File "/home/Plone-4.3.3/zeocluster/bin/paster", line 259, in <module>
    sys.exit(paste.script.command.run())
  File "/home/Plone-4.3.3/buildout-cache/eggs/PasteScript-1.7.5-py2.7.egg/paste/script/command.py", line 104, in run
    invoke(command, command_name, options, args[1:])
  File "/home/Plone-4.3.3/buildout-cache/eggs/PasteScript-1.7.5-py2.7.egg/paste/script/command.py", line 143, in invoke
    exit_code = runner.run(args)
  File "/home/Plone-4.3.3/buildout-cache/eggs/PasteScript-1.7.5-py2.7.egg/paste/script/command.py", line 238, in run
    result = self.command()
  File "/home/Plone-4.3.3/buildout-cache/eggs/PasteScript-1.7.5-py2.7.egg/paste/script/create_distro.py", line 170, in command
    egg_info_dir = pluginlib.egg_info_dir(output_dir, dist_name)
  File "/home/Plone-4.3.3/buildout-cache/eggs/PasteScript-1.7.5-py2.7.egg/paste/script/pluginlib.py", line 135, in egg_info_dir
    % ', '.join(all))
IOError: No egg-info directory found (looked in ./plone_basic/./plone_basic.egg-info, ./plone_basic/setup.py/plone_basic.egg-info, ./plone_basic/plone_basic/plone_basic.egg-info, ./plone_basic/setup.cfg/plone_basic.egg-info)

1 个答案:

答案 0 :(得分:0)

解决方法1

问题似乎是缺少setuptools。安装setuptools之后,paster(以及基于它的所有工具)都可以运行生成的setup.py。以下解决了问题:

wget --no-check-certificate https://bootstrap.pypa.io/ez_setup.py -O - | sudo -u plone_buildout /usr/local/Plone-4.3.3/Python-2.7/bin/python

UnifiedInstaller-4.3.3不会安装setuptools。请参阅此ticket

正如SteveM指出的那样(见评论),这不是推荐的解决方法。

(首选)解决方法2

生成的数据存在(尽管抛出了错误!)但setup.py将无法运行。因此,不会生成Paste*目录。稍后当buildout运行时,它将生成/下载Paste*目录等。

如果要运行setup.py。您可以修补PasteScript(风险自负!)。

至于PasteScript-1.7.5转到/path/to/Plone-4.3.3/buildout-cache/eggs/PasteScript-1.7.5-py2.7.egg/paste/script/command.py的第587行并获取当前的sys.path并将其传递给subprocess.Popen()。这样setup.py将与zopeskelpaste环境一起运行。

current_env = os.environ.copy()
current_env['PYTHONPATH'] = ':'.join(sys.path)
proc = subprocess.Popen([cmd] + list(args),
                        cwd=cwd,
                        stderr=stderr_pipe,
                        stdout=subprocess.PIPE,
                        env=current_env) # <- pass the env here

我将尝试找出此解决方法可能导致问题的情况。我在PasteScripthttps://bitbucket.org/ianb/pastescript/issue/16/pass-the-syspath-to-the-subprocess-in

上发布了一个问题

更新:无需生成/添加Paste* dirs(运行buildout或上面的解决方法),localcommands将无法使用。