- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有三台主机,都运行最新更新的 Ubuntu 18.04:
ansible --version
产生:
ansible 2.9.6
config file = /home/marco/Desktop/playbook/ansible.cfg
configured module search path = [u'/home/marco/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python2.7/dist-packages/ansible
executable location = /usr/bin/ansible
python version = 2.7.17 (default, Nov 7 2019, 10:07:09) [GCC 7.4.0]
ansible.cfg
包含 interpreter_python = auto
行。
我的剧本在使用目标主机登台运行时运行良好。但是当使用目标主机 prod 运行时,运行 expect 时会失败模块:
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ModuleNotFoundError: No module named 'pexpect'
fatal: [prod]: FAILED! => {"changed": false, "msg": "Failed to import the required Python library (pexpect) on prod's Python /usr/bin/python3. Please read module documentation and install 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"}
我试图通过在 master 上安装库来解决问题
apt-get install python-pexpect
apt-get install python-pip
pip install pexpect
然后添加
- name: Install packages
apt:
name:
- python-pexpect
- python-pip
- name: Install Python modules
command: pip install pexpect
到剧本,但没有帮助。
最佳答案
试试内置的 pip
Ansble 模块,它会检测被控节点上使用的是哪个版本的 pip Ansible。
- name: Install pip
apt:
update_cache: yes
name:
- python3-pip
- name: Install pexpect
pip:
name: pexpect
关于python - Ansible 失败并出现 ModuleNotFoundError : No module named 'pexpect' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60893183/
I have installed WeasyPrint==0.42.3 using pip3 install WeasyPrint==0.42.3, but when I try to impo
我正在从远程服务器设置Jupyter笔记本电脑环境。当我导入Notebook.auth时,它报告错误如下:。我的jupyter参数如下所示:。有人知道如何解决这个问题吗?我已经尝试了pip安装jupy
在运行命令时,我遇到了一个错误:Heroku run pythonManage.py Migrate。当我运行它时,它会出现错误:ModuleNotFoundError:没有名为‘Django’的模块
PC:Windows 11 WSL 2,ubuntu-22.04。我打算按照这些说明安装'cnntools'。安装后,我对其进行了测试。这件事就发生了。。我的电脑怎么了?我必须买一台新电脑吗?。我试过
我的文件夹结构是: |-fastapi |-app |-calc.py |-tests |-mytest.py 在 mytest.py 中,我尝试导入 calc.py,
假设我们有以下结构: outer_module.py| |subfolder| |__init__.py
我在 conda 中创建了一个新环境并安装了 yaml。 $ conda list | grep yaml yaml 0.1.7
我使用了来自 python-nmap 的 import nmap 模块,它在 Pycharm 中运行良好。 但是当我尝试在命令提示符下运行相同的程序时,出现错误: ModuleNotFoundErro
my_controller.py 如下: from models import Person david = Person('David') 我的项目结构是 app ├── controller │
我已经使用 tensorflow 构建了一个 python 脚本,现在我正在尝试将其转换为 .exe 文件,但遇到了问题。使用 pyinstaller 并从命令提示符运行程序后,我收到以下错误: Fi
我在网络驱动器上安装了 Python。我用了pushd命令进入同一网络驱动器上我的项目文件夹。我在那个文件夹中打开 python。我尝试导入该文件夹中的模块。一个 ModuleNotFoundErro
我的发行版是WinPython,我使用Spyder作为IDLE,我的python版本是3.6.5。 尽管我有很多模块(来自 WinPython 下载),例如 pip、pandas 和 numpy,它们
我在 macOS Mojave 版本 10.14.1 上使用 Python 3.7.1 这是我的目录结构: man/ Mans/
我的文件夹结构: ttsTacotron.py Tacotron-2 |.. |tacotron| |train.py |synthetizer.py
我正在使用 Python 3.6.0 和 pipenv。我在pycharm中有一个名为myapp的python项目,目录结构为 - myapp - src - __init__.py -
我利用自制程序安装 python3,现在无法运行使用关联的 pip3 二进制文件安装的模块。 from blackduck.HubRestApi import HubInstance username
我正在开发 Flask 应用程序并尝试运行我的测试文件,但无法执行此操作。我当前的应用程序结构是: Project ── app │ ├── __init__.py │ ├── forms.p
(在用重复的问题投票标记我之前,请注意,我在这个问题上找到的所有内容都与 virtualenv 有关,而不是 venv) 系统: Ubuntu 服务器 16.04 已安装 Python 3.6,原生
Visual Studio 2017 - 空 Python 项目我的代码如下所示(是的,只有两行): import pandas as pd import Quandl 我已将 Quandl (3.2
我需要 pickle 我已经实例化的 python 类,因此需要使用相对路径。我正在使用 Python 版本 3.6.6。以下是项目结构和代码的示例: modelling/ test.py
我是一名优秀的程序员,十分优秀!