python-3.x - 如何在 Windows 上执行 python 的 Ansible 模块?
问题描述
我通过 python 3.7 在 Windows Server 2012 上安装了 Ansible(按照这篇文章的说明:https ://stackoverflow.com/a/52614973/7098543 )。
但是,我得到了错误:没有名为 ansible 的模块。主要. 我该如何解决?
我知道 Ansible 不支持在 Windows 上安装控制机。但是,我必须使用 Windows server 2012。
通过 python 3.7 安装 Ansible(版本:2.7.10)后,我尝试运行:
python -m ansible --version
我收到错误:没有名为 ansible 的模块。主要;'ansible' 是一个包,不能直接执行。
任何解决方法?请帮忙。
解决方案
实际上,我没有解决此问题的想法或解决方法。但是,我找到了使用 Cygwin 安装 Ansible 的其他解决方案。
1. Open up a Cygwin Terminal
2. alias cyg-get="/path/to/cygwin/setup/package/setup-x86_64.exe -q -P"
3. cyg-get cygwin32-gcc-g++,gcc-core,gcc-g++,git,libffi-devel,nano,openssl,openssl-devel,python-crypto,python3,python3-devel,python3-openssl,python3-pip,python3-setuptools,python3-devel,tree,wget,zip,make,curl,git python-jinja2,python-six,python-yaml, cryptography
4. curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
5. python3 get-pip.py
6. pip --version
7. git clone --depth 1 git://github.com/ansible/ansible
8. cd ansible
9. python3 setup.py install
希望这篇文章对某人有所帮助!参考链接:
推荐阅读
- youtube-api - youtube search change the pages token
- javascript - How i can make invite logger with Discord.js?
- node.js - How can increment a new field in mongoose rather than update entire document?
- git - Undo changes in code (whole project) to a specific commit but Keep all the "git logs" (using git bash)
- python-3.x - 通过 python 获取所有可用函数的列表,本地的、全局的还是导入的?
- javascript - 创建“快捷方式”来操作深度嵌套的对象键
- javascript - 无法读取未定义的属性“temp”
- javascript - React js CSS模块找不到@keyframes
- javascript - CSS 样式部分应用于 React 组件中的按钮
- firebase - Firebase Firestore 和函数 404 ERR_ABORTED