【发布时间】:2018-09-28 09:35:37
【问题描述】:
我有以下剧本:
---
- hosts: app
become: yes
tasks:
- name: Install MySQL-Python
yum: name=MySQL-python state=present
- name: Install Python Setup Tools
yum: name=python-setuptools state=present
- name: Install django
easy_install: name=django state=present
这失败并出现错误:
此版本的 Django 需要 Python 3.4,但您正尝试在 Python 2.7 上\n安装它。\n\n这可能是因为您使用的 pip 版本\n不理解 python_requires 分类器。确保您\n具有 pip >= 9.0 和 setuptools >= 24.2,然后重试:\n\n $ python -m pip install --upgrade pip setuptools\n $ python -m pip install django\n\n这将安装最新版本的 Django,适用于您的 Python 版本。如果您无法升级您的 pip(或 Python),请请求\nan 旧版本的 Django:\n\n $ python -m pip install \"django
我跟着 this article 安装 Python 3 并设置了 python=python3,但是当我运行 playbook 时遇到同样的错误消息。
任何人都可以建议做什么吗?另外,我是否使用 Ansible 安装以前版本的 Django?
【问题讨论】:
标签: python django ansible rhel