I am using WSL2 to run Ansible on Debian 12.2. When I run a playbook that uses SSH to connect I get the following warning message:
[WARNING]: ansible-pylibssh not installed, falling back to paramiko
I want to use ansible-pylibssh instead of paramiko and I have to install it via apt instead via pip.
I am unable to find that package.
I have tried using apt, apt-get, aptitude with updated list of packages and I am just not able to find that package to install it.
How can I install it on Debian?
Consider whether you need to install it via apt because "pip" says so.
Pip also suggests to use a virtual environment with ansible, and install ansible-pylibssh here.
# Ubuntu 24.04
# create a local virtual environment
$ python3 -m venv .venv
# activate it
$ source .venv/bin/activate
# install ansible and ansible-pylibssh
$ python3 -m pip install ansible ansible-pylibssh
# run ansible command through python
$ python3 -m ansible <some command>
NB: pip does actually have an apt package, so this is good:
$ sudo apt-get install python3-pip
I tried looking for apt packages, I tried pipx, I tried to install pip with get-pip.py, I tried everything. The above got going and I can always put it into a script. So if virtual environments is the right way to do it, so be it.
I wrote about it here: https://variable.dk/2024/12/11/installing-ansible-pylibssh-in-ubuntu-24-04-on-wsl-2/
While it doesn't necessarily answerer the question, how to install ansible-pylibssh via apt, I had good success installing ansible and ansible-pylibssh via pipx
pipx install --include-deps ansible
--include-deps only the ansible community package is installed but not ansible-core.pipx inject ansible ansible-pylibssh
installs ansible-pylibssh into the newly created environment
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With