I have ansible task
- name: Install setuptools in virtual environment
pip:
name: setuptools-git
virtualenv: "myenv"
virtualenv_command: "/root/.pyenv/bin/pyenv virtualenv 2.7.13"
But it gives error
fatal: [localhost]: FAILED! => {
"changed": false,
"invocation": {
"module_args": {
"chdir": null,
"editable": false,
"executable": null,
"extra_args": "",
"name": [
"setuptools-git"
],
"requirements": null,
"state": "present",
"umask": null,
"use_mirrors": true,
"version": null,
"virtualenv": "myenv",
"virtualenv_command": "/root/.pyenv/bin/pyenv virtualenv 2.7.13",
"virtualenv_python": null,
"virtualenv_site_packages": false
}
},
"msg": "Unable to find pip in the virtualenv, myenv, under any of these names: pip2, pip. Make sure pip is present in the virtualenv."
}
When I check the pip file in virtualenv, its already there
# ls /root/.pyenv/versions/myenv/bin/pip
/root/.pyenv/versions/myenv/bin/pip
I cant use executable
with virtualenv
variable.