geerlingguy / ansible-for-kubernetes

Ansible and Kubernetes examples from Ansible for Kubernetes Book
https://www.ansibleforkubernetes.com
MIT License
678 stars 311 forks source link

Unable to run pip on WSL2 #69

Open outlawery opened 3 years ago

outlawery commented 3 years ago

Under the Appendix A section with installing Ansible using pip, I was not able to execute any pip commands within WSL2 environment running Ubuntu 20.04 (on top of Windows 2004 build 19041)..

First of all, instead of sudo apt-get install -y python-pip python-dev for Python 3, I ran sudo apt-get install -y python3-pip python3-dev inside the container which had successfully installed packages accordingly -- however the pip command was still no avail when executing sudo pip install ansible which gave me pip: command not found in this case.

After googling, I was able to find something that worked: sudo python3 -m pip install ansible

Not sure why pip is not registering in WSL environment, even though both python3-pip and python3-dev have been installed cleanly?

P.S. Thank you, Jeff, for authoring this such an amazingly fabulous book, as well as all of your contributions and commitments to the open-source community.. this is my first-ever issue/comment post on GitHub in hope to contribute to your work and your book in a small way! :) Go Drupal! /u/dat-deaf-drupaler

typ-ex commented 3 years ago

I imagine you have figured this out by now. For anybody else looking, the command for the pip repository for python2 is pip. The command for the pip repository in python3 is pip3.