-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
/usr/bin/python3 not found when using pyenv #42
Comments
I am afraid that pyenv is not supported and I do not know a way to make it work, basically you need to build selinux bindings from source and install them, something that is not done by this extension. I think that this also means that you cannot really use ansible from a pyenv environment on selinux enabled systems. I may be wrong but this needs to be confirmed with ansible core team. |
I have the same issue when running
Is the libselinux-python3 package still required to detect that? |
AFAIK yes and also ansible would fail. So is not so much about if you have selinux enabled or not, whenver is available, ansible would ask about missing bindings. |
Are you really sure about that? I've been running tests on several gitlab-runners (CentOS 7) with molecule. When we switched from Python 2 to Python 3 for Ansible, I had issues because there were no libselinux-python3 RPM for CentOS 7 at the time. Disabling selinux fixed the problem (it was in permissive mode before). I've been running tests successfully with ansible 2.9.11, ansible-lint 4.2.0, molecule 2.22 without bindings. It's when upgrading to molecule 3.0.8 and ansible-lint 4.3.0 that I got an issue again and was forced to install libselinux-python3. |
You did not search well enough, the python3 library rpm is called |
I know it is available now. My point was that it wasn't at the time we switched to Python 3, but I could make ansible work. I think you are the one that opened this issue: https://bugs.centos.org/view.php?id=16389 |
Yes, I did. It was fixed after I lost hope. Lots of things changed in regards to python3 and centos-7, as some unprecedented backporting of python3.6 occurred in 7.8 -- a very useful move as it allows people to switch from py2 to py3 without having to also switch the entire operating system. |
I'm using pyenv. I did try to edit it to change the system python to /usr/bin/python, I got no errors but it just failed to work.
My python is: ~/.pyenv/versions/venv-3.6.9/bin/python3 version 3.6.9
I have selinux loaded in my virtual env:
The text was updated successfully, but these errors were encountered: