无法安装 zc.buildout with zc.recipe.egg with Python 3.6 或更高版本
Can't install zc.buildout with zc.recipe.egg with Python 3.6 or higher
我使用 zc.buildout(与 zc.recipe.egg)很长时间以来构建我的 Python 包和部署我的 运行 环境。
这几天,我不能再用任何Python 3.5 以上的版本了! :(
启动时,我收到一个错误(这里是 Gitlab-CI 作业):
$ pip install zc.buildout
Collecting zc.buildout
Downloading zc.buildout-2.13.3-py2.py3-none-any.whl (153 kB)
Requirement already satisfied: setuptools>=8.0 in /usr/local/lib/python3.6/site-packages (from zc.buildout) (52.0.0)
Installing collected packages: zc.buildout
Successfully installed zc.buildout-2.13.3
$ buildout
Setting socket time out to 3 seconds.
Creating directory '/builds/G3v_6jyd/0/onf/support/python/pyramid/pyams-v2/pyams-security/develop-eggs'.
Develop: '/builds/G3v_6jyd/0/onf/support/python/pyramid/pyams-v2/pyams-security/.'
warning: no files found matching '*.txt'
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*.*~' found anywhere in distribution
Couldn't develop '/builds/G3v_6jyd/0/onf/support/python/pyramid/pyams-v2/pyams-security/../ext/lingua' (not found)
Couldn't develop '/builds/G3v_6jyd/0/onf/support/python/pyramid/pyams-v2/pyams-security/../pyams_catalog' (not found)
Couldn't develop '/builds/G3v_6jyd/0/onf/support/python/pyramid/pyams-v2/pyams-security/../pyams_file' (not found)
Couldn't develop '/builds/G3v_6jyd/0/onf/support/python/pyramid/pyams-v2/pyams-security/../pyams_i18n' (not found)
Couldn't develop '/builds/G3v_6jyd/0/onf/support/python/pyramid/pyams-v2/pyams-security/../pyams_mail' (not found)
Couldn't develop '/builds/G3v_6jyd/0/onf/support/python/pyramid/pyams-v2/pyams-security/../pyams_site' (not found)
Couldn't develop '/builds/G3v_6jyd/0/onf/support/python/pyramid/pyams-v2/pyams-security/../pyams_utils' (not found)
Getting distribution for 'zc.recipe.egg==2.0.7'.
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: cannot import name 'main'
An error occurred when trying to install /tmp/tmp9eg4_d0rget_dist/zc.recipe.egg-2.0.7.tar.gz. Look above this message for any errors that were output by easy_install.
While:
Installing.
Getting section package.
Initializing section package.
Installing recipe zc.recipe.egg.
Getting distribution for 'zc.recipe.egg==2.0.7'.
An internal error occurred due to a bug in either zc.buildout or in a
recipe being used:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/zc/buildout/buildout.py", line 2174, in main
getattr(buildout, command)(args)
File "/usr/local/lib/python3.6/site-packages/zc/buildout/buildout.py", line 701, in install
[self[part]['recipe'] for part in install_parts]
File "/usr/local/lib/python3.6/site-packages/zc/buildout/buildout.py", line 701, in <listcomp>
[self[part]['recipe'] for part in install_parts]
File "/usr/local/lib/python3.6/site-packages/zc/buildout/buildout.py", line 1324, in __getitem__
options._initialize()
File "/usr/local/lib/python3.6/site-packages/zc/buildout/buildout.py", line 1432, in _initialize
self.initialize()
File "/usr/local/lib/python3.6/site-packages/zc/buildout/buildout.py", line 1438, in initialize
recipe_class = _install_and_load(reqs, 'zc.buildout', entry, buildout)
File "/usr/local/lib/python3.6/site-packages/zc/buildout/buildout.py", line 1388, in _install_and_load
allow_hosts=buildout._allow_hosts
File "/usr/local/lib/python3.6/site-packages/zc/buildout/easy_install.py", line 957, in install
return installer.install(specs, working_set)
File "/usr/local/lib/python3.6/site-packages/zc/buildout/easy_install.py", line 682, in install
for dist in self._get_dist(requirement, ws):
File "/usr/local/lib/python3.6/site-packages/zc/buildout/easy_install.py", line 574, in _get_dist
dists = [_move_to_eggs_dir_and_compile(dist, self._dest)]
File "/usr/local/lib/python3.6/site-packages/zc/buildout/easy_install.py", line 1745, in _move_to_eggs_dir_and_compile
[tmp_loc] = glob.glob(os.path.join(tmp_dest, '*'))
ValueError: not enough values to unpack (expected 1, got 0)
我实际上使用的是最新的安装工具版本 (52.0.0),我需要能够为所有 Python 版本从 3.5 到 3.9 构建我的包...
有什么想法吗?
此致,
蒂埃里
我遇到了同样的问题,相信我已经找到了潜在的问题。
最新的 setuptools
版本 (52.0.0) 删除了 zc.buildout
使用的 easy_install
。
参考这个 PR:https://github.com/pypa/setuptools/pull/2544
要解决(至少现在),您可以显式 install/require 以前的版本 setuptools
。
作为对 Max Billingsley III 的回答的补充:
带有 zc.buildout 2.13.3
的 setuptools
当前最后一个工作版本是 51.3.3
。
我创建了一个 pull request to add this install requirement to zc.buildout
, which - before merging - needs another pull request 来修复 buildout
损坏的构建管道。
已经有一个 zc.buildout
的 alpha version 应该也可以工作 - 无需固定 setuptools
因为它不再使用 easy_install
而是 pip
.
我使用 zc.buildout(与 zc.recipe.egg)很长时间以来构建我的 Python 包和部署我的 运行 环境。
这几天,我不能再用任何Python 3.5 以上的版本了! :(
启动时,我收到一个错误(这里是 Gitlab-CI 作业):
$ pip install zc.buildout
Collecting zc.buildout
Downloading zc.buildout-2.13.3-py2.py3-none-any.whl (153 kB)
Requirement already satisfied: setuptools>=8.0 in /usr/local/lib/python3.6/site-packages (from zc.buildout) (52.0.0)
Installing collected packages: zc.buildout
Successfully installed zc.buildout-2.13.3
$ buildout
Setting socket time out to 3 seconds.
Creating directory '/builds/G3v_6jyd/0/onf/support/python/pyramid/pyams-v2/pyams-security/develop-eggs'.
Develop: '/builds/G3v_6jyd/0/onf/support/python/pyramid/pyams-v2/pyams-security/.'
warning: no files found matching '*.txt'
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*.*~' found anywhere in distribution
Couldn't develop '/builds/G3v_6jyd/0/onf/support/python/pyramid/pyams-v2/pyams-security/../ext/lingua' (not found)
Couldn't develop '/builds/G3v_6jyd/0/onf/support/python/pyramid/pyams-v2/pyams-security/../pyams_catalog' (not found)
Couldn't develop '/builds/G3v_6jyd/0/onf/support/python/pyramid/pyams-v2/pyams-security/../pyams_file' (not found)
Couldn't develop '/builds/G3v_6jyd/0/onf/support/python/pyramid/pyams-v2/pyams-security/../pyams_i18n' (not found)
Couldn't develop '/builds/G3v_6jyd/0/onf/support/python/pyramid/pyams-v2/pyams-security/../pyams_mail' (not found)
Couldn't develop '/builds/G3v_6jyd/0/onf/support/python/pyramid/pyams-v2/pyams-security/../pyams_site' (not found)
Couldn't develop '/builds/G3v_6jyd/0/onf/support/python/pyramid/pyams-v2/pyams-security/../pyams_utils' (not found)
Getting distribution for 'zc.recipe.egg==2.0.7'.
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: cannot import name 'main'
An error occurred when trying to install /tmp/tmp9eg4_d0rget_dist/zc.recipe.egg-2.0.7.tar.gz. Look above this message for any errors that were output by easy_install.
While:
Installing.
Getting section package.
Initializing section package.
Installing recipe zc.recipe.egg.
Getting distribution for 'zc.recipe.egg==2.0.7'.
An internal error occurred due to a bug in either zc.buildout or in a
recipe being used:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/zc/buildout/buildout.py", line 2174, in main
getattr(buildout, command)(args)
File "/usr/local/lib/python3.6/site-packages/zc/buildout/buildout.py", line 701, in install
[self[part]['recipe'] for part in install_parts]
File "/usr/local/lib/python3.6/site-packages/zc/buildout/buildout.py", line 701, in <listcomp>
[self[part]['recipe'] for part in install_parts]
File "/usr/local/lib/python3.6/site-packages/zc/buildout/buildout.py", line 1324, in __getitem__
options._initialize()
File "/usr/local/lib/python3.6/site-packages/zc/buildout/buildout.py", line 1432, in _initialize
self.initialize()
File "/usr/local/lib/python3.6/site-packages/zc/buildout/buildout.py", line 1438, in initialize
recipe_class = _install_and_load(reqs, 'zc.buildout', entry, buildout)
File "/usr/local/lib/python3.6/site-packages/zc/buildout/buildout.py", line 1388, in _install_and_load
allow_hosts=buildout._allow_hosts
File "/usr/local/lib/python3.6/site-packages/zc/buildout/easy_install.py", line 957, in install
return installer.install(specs, working_set)
File "/usr/local/lib/python3.6/site-packages/zc/buildout/easy_install.py", line 682, in install
for dist in self._get_dist(requirement, ws):
File "/usr/local/lib/python3.6/site-packages/zc/buildout/easy_install.py", line 574, in _get_dist
dists = [_move_to_eggs_dir_and_compile(dist, self._dest)]
File "/usr/local/lib/python3.6/site-packages/zc/buildout/easy_install.py", line 1745, in _move_to_eggs_dir_and_compile
[tmp_loc] = glob.glob(os.path.join(tmp_dest, '*'))
ValueError: not enough values to unpack (expected 1, got 0)
我实际上使用的是最新的安装工具版本 (52.0.0),我需要能够为所有 Python 版本从 3.5 到 3.9 构建我的包...
有什么想法吗?
此致,
蒂埃里
我遇到了同样的问题,相信我已经找到了潜在的问题。
最新的 setuptools
版本 (52.0.0) 删除了 zc.buildout
使用的 easy_install
。
参考这个 PR:https://github.com/pypa/setuptools/pull/2544
要解决(至少现在),您可以显式 install/require 以前的版本 setuptools
。
作为对 Max Billingsley III 的回答的补充:
带有 zc.buildout 2.13.3
的 setuptools
当前最后一个工作版本是 51.3.3
。
我创建了一个 pull request to add this install requirement to zc.buildout
, which - before merging - needs another pull request 来修复 buildout
损坏的构建管道。
已经有一个 zc.buildout
的 alpha version 应该也可以工作 - 无需固定 setuptools
因为它不再使用 easy_install
而是 pip
.