-2

Ubuntu 21.10 Ansible 2.10.8 hcloud 1.16.0 Python 3.9.7

在全新安装的 Ansible 和 Hetzner 的 hcloud Python 模块上运行 Ansible playbook,出现错误并且脚本被中止: Failed to import the required Python library (hcloud-python) on laptop's Python /usr/bin/python3. Please read the module documentation and install it in the appropriate location. If the required library is installed, but Ansible is using the wrong Python interpreter, please consult the documentation on ansible_python_interpreter

该剧本在装有 Ansible 2.11.1 和 hcloud 1.12 (Python 3.9.5) 的 MacBook Pro 笔记本电脑上运行良好。

我在互联网上没有找到很多关于这个问题的信息......

4

1 回答 1

0

找到了罪魁祸首...... ansible 的 Debian(和 Ubuntu)软件包曾经依赖于 python2,这就是为什么它不会使用 python3 库......

实际上我使用apt install ansible命令安装了ansible

于 2021-11-15T08:57:55.217 回答