gpt4 book ai didi

ubuntu - Ansible 无法找到 requirements.txt

转载 作者:行者123 更新时间:2023-12-04 18:57:35 25 4
gpt4 key购买 nike

我的目录结构是这样的

$ tree
├── Vagrantfile
├── files
│   ├── cmake
│   ├── pip-requirements.txt
│   └── profile
└── tasks
└── main.yml
main.yml的内容
---
- hosts: kurseve
tasks:
- name: Install pip
pip:
requirements: ../files/pip-requirements.txt
virtualenv: /home/vagrant/venvs/cv
virtualenv_python: python2.7

但是当我尝试使用命令 vagrant up --provision 配置 Vagrant 框时从项目根目录。错误日志显示 ansible 无法找到 pip-requirements.txt放在 files/里面

这是错误日志
fatal: [kurseve]: FAILED! => {
"changed": false,
"cmd": "/home/vagrant/venvs/cv/bin/pip2 install -r ../files/pip-requirements.txt",
"failed": true,
"invocation": {
"module_args": {
"chdir": null,
"editable": true,
"executable": null,
"extra_args": null,
"name": null,
"requirements": "../files/pip-requirements.txt",
"state": "present",
"umask": null,
"use_mirrors": true,
"version": null,
"virtualenv": "/home/vagrant/venvs/cv",
"virtualenv_command": "virtualenv",
"virtualenv_python": "python2.7",
"virtualenv_site_packages": false
},
"module_name": "pip"
},
"msg": "\n:stderr: Could not open requirements file: [Errno 2] No such file or directory: '../files/pip-requirements.txt'\n"
}

最佳答案

pip模块期望 requirements要在目标框上的文件:

The path to a pip requirements file, which should be local to the remote system. File can be specified as a relative path if using the chdir option.



因此,如果您的配置过程没有将您的本地文件夹复制/链接到 vagrant box,则没有 pip-requirements.txt可用的。

关于ubuntu - Ansible 无法找到 requirements.txt,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42492956/

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