gpt4 book ai didi

python - Ansible Flask 教程无法安装

转载 作者:太空宇宙 更新时间:2023-11-03 17:30:20 25 4
gpt4 key购买 nike

我正在关注本教程: http://mattupstate.com/python/devops/2012/08/07/flask-wsgi-application-deployment-with-ubuntu-ansible-nginx-supervisor-and-uwsgi.html

我在 EC2 上安装了 Ubuntu 镜像并尝试运行 playbook,但出现以下错误:

TASK: [install common packages needed for python application development] *****
failed: [54.173.67.23] => (item=libpq-dev,libmysqlclient-dev,libxml2-dev,libjpeg62,libjpeg62-dev,libfreetype6,libfreetype6-dev,zlib1g-dev,mysql-client,python-dev,python-setuptools,python-imaging,python-mysqldb,python-psycopg2,git-core,nginx) => {"failed": true, "item": "libpq-dev,libmysqlclient-dev,libxml2-dev,libjpeg62,libjpeg62-dev,libfreetype6,libfreetype6-dev,zlib1g-dev,mysql-client,python-dev,python-setuptools,python-imaging,python-mysqldb,python-psycopg2,git-core,nginx"}
msg: No package matching '$item' is available
FATAL: all hosts have already failed -- aborting

不确定出了什么问题?

最佳答案

您引用的教程已过时。 Ansible playbook 使用的语法现在无效。试试这个吧

- name: Install python packages
connection: local
hosts: 127.0.0.1
tasks:
- name: add nginx ppa
apt_repository:
repo: "ppa:nginx/stable"

- name: install common packages needed for python application development
apt:
name: "{{ item }}"
with_items:
- libpq-dev
- libmysqlclient-dev
- libxml2-dev
- libjpeg62
- libjpeg62-dev
- libfreetype6
- libfreetype6-dev
- zlib1g-dev
- mysql-client
- python-dev
- python-setuptools
- python-imaging
- python-mysqldb
- python-psycopg2
- git-core
- nginx

- name: install pip
easy_install:
name: pip

- name: install various libraries with pip
pip:
name: "{{ item }}"
with_items:
- virtualenv
- supervisor
- uwsgi

关于python - Ansible Flask 教程无法安装,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31932840/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com