[英]“IOError: No egg-info directory found” with paster on Plone 4.3.3
The error occurs also when using zopeskel in Plone 4.3.3. 在Plone 4.3.3中使用zopeskel时也会发生该错误。 This seem to be slightly different from this question .
这似乎与这个问题略有不同。 Under Plone 4.3.2 there is no error.
在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)
workaround 1 : 解决方法1 :
The problem seems to be the missing setuptools
. 问题似乎是缺少
setuptools
。 After installing setuptools, then paster (and all tools based on it) can run the generated setup.py. 安装setuptools之后,粘贴程序(以及所有基于它的工具)可以运行生成的setup.py。 The following fixed the problem:
以下内容解决了该问题:
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 doesn't install setuptools. UnifiedInstaller-4.3.3不会安装setuptools。 See this ticket .
看这张票 。
As SteveM points out (see comments) this is not a recommended workaround. 正如SteveM指出的那样(请参见注释),这不是建议的解决方法。
(prefered) workaround 2 : (首选)解决方法2 :
The generated data is there (despite the thrown error!) but setup.py will not run. 生成的数据在那里(尽管抛出错误!),但是setup.py无法运行。 Thus the
Paste*
directories will not be generated. 因此,将不会生成
Paste*
目录。 Later when buildout runs it will generate/download the Paste*
directories etc. 稍后当构建运行时,它将生成/下载
Paste*
目录等。
If you want setup.py to be run. 如果要运行setup.py。 You could patch PasteScript (at your own risk!).
您可以修补PasteScript(后果自负!)。
As for PasteScript-1.7.5
go to line #587 of /path/to/Plone-4.3.3/buildout-cache/eggs/PasteScript-1.7.5-py2.7.egg/paste/script/command.py
and get the current sys.path and pass it to subprocess.Popen()
. 对于
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()
。 This way the setup.py
will run with the zopeskel
or paste
environment. 这样
setup.py
将在zopeskel
或paste
环境中运行。
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
I'll try to figure out situations where this workaround could cause problems. 我将尝试找出这种解决方法可能导致问题的情况。 I've posted an issue on
PasteScript
: https://bitbucket.org/ianb/pastescript/issue/16/pass-the-syspath-to-the-subprocess-in 我在
PasteScript
上发布了一个问题: https : PasteScript
Update : without generating/adding the Paste*
dirs (either running buildout or by workaround as above) localcommands won't be available. 更新 :不生成/添加
Paste*
目录(无论是运行构建还是通过上述替代方法),本地命令将不可用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.