我正在使用 OSX.10.12.4
操作系统。
我从 Github 上下载了 Ansible 并尝试运行它。当我执行 Ansible 时,出现了以下内容:
$> ansible
ERROR! Unexpected Exception: 'module' object has no attribute '_vendor'
the full traceback was:
Traceback (most recent call last):
File "/Users/juneyoungoh/Documents/DEV_TEST/ansible/ansible/bin/ansible", line 88, in <module>
mycli = getattr(__import__("ansible.cli.%s" % sub, fromlist=[myclass]), myclass)
File "/Users/juneyoungoh/Documents/DEV_TEST/ansible/ansible/lib/ansible/cli/__init__.py", line 28, in <module>
import yaml
File "build/bdist.macosx-10.12-intel/egg/yaml/__init__.py", line 14, in <module>
File "build/bdist.macosx-10.12-intel/egg/yaml/cyaml.py", line 5, in <module>
File "build/bdist.macosx-10.12-intel/egg/_yaml.py", line 7, in <module>
File "build/bdist.macosx-10.12-intel/egg/_yaml.py", line 3, in __bootstrap__
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 90, in <module>
packaging = pkg_resources._vendor.packaging
AttributeError: 'module' object has no attribute '_vendor'
本地安装了2个版本的 Python (2.7.10
和 3.6.1
),这可能导致出现错误。如何解决?
- 我想使用二进制源安装,而不是使用
brew install ansible
或者pip install ansible
。
谢谢。