ansible --version报错this is probably a bug: name ‘platform_system’ is not defined

为提高效率,提问时请提供以下信息,问题描述清晰可优先响应。

  • 【TiDB 版本】:3.0.11和3.0.12
  • 【问题描述】:ansible --version报错 按照官方文档,安装 TiDB Ansible 及其依赖后,ansible --version报错 报错如下: ERROR! Unexpected Exception, this is probably a bug: name ‘platform_system’ is not defined the full traceback was:

Traceback (most recent call last): File “/bin/ansible”, line 97, in mycli = getattr(import(“ansible.cli.%s” % sub, fromlist=[myclass]), myclass) File “/usr/lib/python2.7/site-packages/ansible/cli/init.py”, line 38, in from ansible.inventory.manager import InventoryManager File “/usr/lib/python2.7/site-packages/ansible/inventory/manager.py”, line 38, in from ansible.plugins.loader import inventory_loader File “/usr/lib/python2.7/site-packages/ansible/plugins/loader.py”, line 22, in from ansible.parsing.utils.yaml import from_yaml File “/usr/lib/python2.7/site-packages/ansible/parsing/utils/yaml.py”, line 17, in from ansible.parsing.yaml.loader import AnsibleLoader File “/usr/lib/python2.7/site-packages/ansible/parsing/yaml/loader.py”, line 30, in from ansible.parsing.yaml.constructor import AnsibleConstructor File “/usr/lib/python2.7/site-packages/ansible/parsing/yaml/constructor.py”, line 29, in from ansible.parsing.vault import VaultLib File “/usr/lib/python2.7/site-packages/ansible/parsing/vault/init.py”, line 42, in from cryptography.hazmat.backends import default_backend File “/usr/lib64/python2.7/site-packages/cryptography/hazmat/backends/init.py”, line 7, in import pkg_resources File “/usr/lib/python2.7/site-packages/pkg_resources.py”, line 3007, in working_set.require(requires) File “/usr/lib/python2.7/site-packages/pkg_resources.py”, line 728, in require needed = self.resolve(parse_requirements(requirements)) File “/usr/lib/python2.7/site-packages/pkg_resources.py”, line 631, in resolve requirements.extend(dist.requires(req.extras)[::-1]) File “/usr/lib/python2.7/site-packages/pkg_resources.py”, line 2489, in requires dm = self._dep_map File “/usr/lib/python2.7/site-packages/pkg_resources.py”, line 2700, in _dep_map self.__dep_map = self._compute_dependencies() File “/usr/lib/python2.7/site-packages/pkg_resources.py”, line 2733, in _compute_dependencies common = frozenset(reqs_for_extra(None)) File “/usr/lib/python2.7/site-packages/pkg_resources.py”, line 2730, in reqs_for_extra if req.marker_fn(override={‘extra’:extra}): File “/usr/lib/python2.7/site-packages/_markerlib/markers.py”, line 113, in marker_fn return eval(compiled_marker, environment) File “”, line 1, in NameError: name ‘platform_system’ is not defined

你好,

感谢提问,我们看下~

3.0 版本也可以使用 tiup 部署哦~ 欢迎使用

你好,会不会是操作系统的版本问题 ,这个报错是在centos 7.7上面报的,我在centos7.3上面没有报这个错误

pip install --upgrade pip pip install --upgrade setuptools 升级一下这2个就解决问题了

:+1:

推荐使用 tiup 部署 3,0 以上的 tidb 哦~

ansible 的依赖会重一些

asktug.com 检索下关键字 platform_system,有类似的解决方案哦~

好的 谢谢!

:+1::+1::+1:

你好,我试了 还是不行,我重新换个版本看一下,谢谢!

我的可以了,

:call_me_hand::call_me_hand::call_me_hand: