从bitbucket管道部署我的Elastic beantalk应用程序时遇到麻烦。 相同的代码一直没有问题,所以我最好的猜测是某种依赖性问题。
(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'})
因此,如果我没看错,我需要的PyYAML 4.1小于4。
任何有关如何解决此冲突的见解将不胜感激。 感谢您的阅读。
答案 0 :(得分:9)
我更改了pip安装行,以显式使用旧版本的PyYAML,这似乎行得通...
已更改
pip install awsebcli --upgrade
收件人
pip install pyYAML==3.12 awsebcli --upgrade