-
Notifications
You must be signed in to change notification settings - Fork 24k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
module_stdout: "/bin/sh: 1: /usr/bin/python: not found\r\n", #19605
Comments
Please use the issue template instead of deleting it- this is not an actionable or useful bug report. I suspect you're running Ubuntu 16+ or something else without a default python3 installed, but we can't tell that without a full bug report. |
The latest images in AWS don't have a usable Python installed... you need to add this as a pre-task:
I have to use this in my tasks to get the AMI to work nicely with Ansible. |
Ubuntu Xenial has Python3 installed by default and I think it is located at See this answer: http://stackoverflow.com/questions/32429259/ansible-fails-with-bin-sh-1-usr-bin-python-not-found Note that it is important to disable fact gathering for the initialization tasks. |
Yeah, the python interpreter's path can be given on run time as But there has to be some way in ansible configuration file where we can mention the python interpreter path OR is it there? If not there, then it needs to be implemented. |
Just use |
@guruprasad85 This issue is waiting for your response. Please respond or the issue will be closed. |
@guruprasad85 Greetings! Thanks for taking the time to open this issue. In order for the community to handle your issue effectively, we need a bit more information. Here are the items we could not find in your description:
Please set the description of this issue with this template: |
Since I needed python2, I added as first task:
More infos here |
@guruprasad85 This issue is waiting for your response. Please respond or the issue will be closed. |
The above explanations are sufficient to resolving this issue. Some additional reading: If you have further questions please stop by IRC or the mailing list:
|
You can also disable the Gathering Facts, put this in your book
|
@bcoca @sivel are there any plans to revisit this ? It seems to me like Ansible should at least attempt to use
|
For posterity, this is a known improvement opportunity for Ansible and is being considered for inclusion in the roadmap for >=2.8 |
In my case(ansible 2.7.0): $ll |grep python why softlink don't work either? |
sorry,it my fault.Use softlink,it works |
a simple : ln -s /usr/bin/python3 /usr/bin/python resolved my issue |
Thanks, it works now |
This seems to have issues with pyenv It should shim it, but I'm guessing that Ansible is hard coded to look at If so, is this ever likely to change? Or is there a workaround I can use? |
No, it is not. You would need to explicitly set Which in the case of |
ansible -m ping -u ubuntu us-west-2a
35.166.197.222 | FAILED! => {
"changed": false,
"failed": true,
"module_stderr": "Shared connection to 35.166.197.222 closed.\r\n",
"module_stdout": "/bin/sh: 1: /usr/bin/python: not found\r\n",
"msg": "MODULE FAILURE"
}
The text was updated successfully, but these errors were encountered: