`eb init` 因 pkg_resources.ContextualVersionConflict PyYAML 4.1 而失败
`eb init` fails with pkg_resources.ContextualVersionConflict PyYAML 4.1
我在从 bitbucket 管道部署我的弹性 beanstalk 应用程序时遇到了一些问题。同样的代码一直没有问题,所以我最好的猜测是某种依赖性问题。
(awsebcli 版本 3.14.1)
管道的图像是 python:3.5.2
这是失败的步骤:
- step:
name: Test Deploy
deployment: test
caches:
- pip
script:
- pip install awsebcli --upgrade
- eb init myAppName -r us-east-1 -p Python # This line started failing :'(
- eb deploy myAppName-dev-1
和错误输出:
eb init myAppName -r us-east-1 -p Python
Traceback (most recent call last):
File "/usr/local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 570, in _build_master
ws.require(__requires__)
File "/usr/local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 888, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 779, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (PyYAML 4.1 (/usr/local/lib/python3.5/site-packages), Requirement.parse('PyYAML<4,>=3.10'), {'docker-compose'})
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/bin/eb", line 6, in <module>
from pkg_resources import load_entry_point
File "/usr/local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 3095, in <module>
@_call_aside
File "/usr/local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 3079, in _call_aside
f(*args, **kwargs)
File "/usr/local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 3108, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 572, in _build_master
return cls._build_from_requirements(__requires__)
File "/usr/local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 585, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/usr/local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 779, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (PyYAML 4.1 (/usr/local/lib/python3.5/site-packages), Requirement.parse('PyYAML<4,>=3.10'), {'docker-compose'})
因此,如果我没看错的话,当我需要少于 4 的东西时,我有 PyYAML 4.1。
我更改了 pip 安装行以明确使用旧版本的 PyYAML,这似乎有效...
已更改
pip install awsebcli --upgrade
至
pip install pyYAML==3.12 awsebcli --upgrade
我在从 bitbucket 管道部署我的弹性 beanstalk 应用程序时遇到了一些问题。同样的代码一直没有问题,所以我最好的猜测是某种依赖性问题。
(awsebcli 版本 3.14.1)
管道的图像是 python:3.5.2
这是失败的步骤:
- step:
name: Test Deploy
deployment: test
caches:
- pip
script:
- pip install awsebcli --upgrade
- eb init myAppName -r us-east-1 -p Python # This line started failing :'(
- eb deploy myAppName-dev-1
和错误输出:
eb init myAppName -r us-east-1 -p Python
Traceback (most recent call last):
File "/usr/local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 570, in _build_master
ws.require(__requires__)
File "/usr/local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 888, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 779, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (PyYAML 4.1 (/usr/local/lib/python3.5/site-packages), Requirement.parse('PyYAML<4,>=3.10'), {'docker-compose'})
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/bin/eb", line 6, in <module>
from pkg_resources import load_entry_point
File "/usr/local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 3095, in <module>
@_call_aside
File "/usr/local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 3079, in _call_aside
f(*args, **kwargs)
File "/usr/local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 3108, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 572, in _build_master
return cls._build_from_requirements(__requires__)
File "/usr/local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 585, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/usr/local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 779, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (PyYAML 4.1 (/usr/local/lib/python3.5/site-packages), Requirement.parse('PyYAML<4,>=3.10'), {'docker-compose'})
因此,如果我没看错的话,当我需要少于 4 的东西时,我有 PyYAML 4.1。
我更改了 pip 安装行以明确使用旧版本的 PyYAML,这似乎有效...
已更改
pip install awsebcli --upgrade
至
pip install pyYAML==3.12 awsebcli --upgrade