geerlingguy / geerlingguy/ansible-for-devops

Appendix A, Installing Ansible inside WSL

Open
#396 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
9.9k
Forks
3.8k
PR merge metrics
No merged PRs in 30d

Description

You recommend to install ansible using "pip3 install ansible" command.
This cause the package and its dependencies not yet installed, especially ansible-base package, to be installed under
/home//.local/lib/python3.8/site-packages/, and ansible executable modules, which are part of ansible-base package, to be installed under ./home//.local/bin/.
So if the above path not defined under user's PATH variable, the ansible command wouldn't be found.
On the other hand, if you install ansible using "sudo pip3 install ansible", the packages will be installed under
/usr/local/lib/python3.8/dist-packages and ansible executable files will be installed under /usr/local/bin/ which is always defined in the PATH variable.
So you can recommend either to add ./home//.local/bin/ to PATH or just to install ansible using sudo.
if you want to reproduce the case, please don't forget to remove ./home//.local/bin/ from PATH and uninstall ansible and ansible-base before reinstalling it.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.