python-3.x - 找不到任何pip2,要使用pip。pip 需要安装
问题描述
我使用来自 venv 的 ansible 2.9 我在 AWS Linux
中使用 python 3.7 创建远程主机使用默认的 python 2.7,我无法升级它
我正在使用 boto3 并且需要安装它,但首先,我需要在远程安装 pip
我尝试调用它,但我不断得到:
fatal: [10.0.6.182]: FAILED! => changed=false
invocation:
module_args:
chdir: null
editable: false
executable: null
extra_args: null
name:
- pip
requirements: null
state: latest
umask: null
version: null
virtualenv: null
virtualenv_command: virtualenv
virtualenv_python: null
virtualenv_site_packages: false
msg: Unable to find any of pip2, pip to use. pip needs to be installed.
我正在使用 :
- name: Upgrade pip
pip: name=pip state=latest
tags:
- packages
- name: Ensure botocore and boto3 modules are installed
pip:
name: [ "boto3", "botocore"]
extra_args: "--user"
解决方案
我认为您需要先使用 yum 安装 python2-pip,请尝试一下。如果您还有其他问题,请告诉我。
- name: install python2-pip
yum:
name: python2-pip
state: present
- name: Upgrade pip
pip: name=pip state=latest
tags:
- packages
- name: Ensure botocore and boto3 modules are installed
pip:
name: [ "boto3", "botocore"]
extra_args: "--user"
推荐阅读
- spring - 如果 json 对象在 post 请求中缺少键,则引发错误
- python - (Python)我怎样才能知道是否有其他相等的相反符号的值?
- python - 使用 Python 聚合另一列的值的列
- python - vscode 使用方法:from png import *
- java - 使用 HashMap 查找重复项
- javascript - 处理 http 测试请求中的错误
- arrays - 如何在 Matlab 上展开矩阵?
- javascript - 如何在 React 组件中每分钟调用一个函数?
- firebase - firebase-ml-languageIdentifier中'iw'语言代码的含义是什么?(扑)
- android - CollapsingToolbar, Viewpager 有 recyclerview 和 NestedScrollview