Closed jawilk23 closed 10 months ago
I did also perform the pip3 install --user -r requirements.txt command before the ansible-galaxy commands.
Contents of ansible-galaxy file:
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import re
import sys
from ansible.cli.galaxy import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main())
If you have both python 2 and python 3 on your system you have to make sure that python 3 is the default version for both the python and pip executables.
Python 3.10 is the default for both pip and python executables, yet I am still getting the same error.
Seems like an ansible issue. I'd say find another system and try fresh with python3 pip3 and ansible in a clean state.
Marking as stale/inactive. If there are additional questions, please open a new Github issue.
Closing #284 as completed.
Attempting to add users to an internal account when I received an error:
"Failed to import the required Python library (openshift) on cldlgn05.unx.sas.com's Python /usr/bin/python3. Please read the module documentation and install it in the appropriate location. If the required library is installed, but Ansible is using the wrong Python interpreter, please consult the documentation on ansible_python_interpreter"
I realized there had been a new project released yesterday, so I cloned the new project and while executing:
ansible-galaxy collection install -r requirements.yaml -f ansible-galaxy role install -r requirements.yaml -f
Received the following error:
File "/usr/local/bin/ansible-playbook", line 5, in
from ansible.cli.playbook import main
ImportError: cannot import name 'main' from 'ansible.cli.playbook' (/r/ge.unx.sas.com/vol/vol410/u41/jawilk/.local/lib/python3.10/site-packages/ansible/cli/playbook.py)