ansible / pylibssh

Python bindings specific to Ansible use case for libssh https://www.libssh.org/
https://ansible-pylibssh.rtfd.io
GNU Lesser General Public License v2.1
59 stars 28 forks source link

failed to install pylibssh under WSL ubuntu24.04 #593

Closed qqkkll closed 1 month ago

qqkkll commented 1 month ago

I upgrade my WSL ubuntu22.04 to 24.04 and I encounter issue to install pylibssh as below, is anybody facing same issue and know how to fix it?

(ansible) netops@W11D8VY5G3:~/playbooks$ pip install ansible-pylibssh
Collecting ansible-pylibssh
  Using cached ansible-pylibssh-1.1.0.tar.gz (106 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: ansible-pylibssh
  Building wheel for ansible-pylibssh (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for ansible-pylibssh (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      [1/1] Cythonizing /tmp/pip-install-it43s5xf/ansible-pylibssh_248cc0039c3f4480a9ac152035d3a83c/src/pylibsshext/scp.pyx
      /tmp/pip-install-it43s5xf/ansible-pylibssh_248cc0039c3f4480a9ac152035d3a83c/src/pylibsshext/scp.c:1239:10: fatal error: libssh/libssh.h: No such file or directory
       1239 | #include "libssh/libssh.h"
            |          ^~~~~~~~~~~~~~~~~
      compilation terminated.
      error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for ansible-pylibssh
Failed to build ansible-pylibssh
ERROR: Could not build wheels for ansible-pylibssh, which is required to install pyproject.toml-based projects
webknjaz commented 1 month ago

Perhaps, pip was able to select a pre-compiled wheel in the older system but not the newer one. If you want to compile it, you have to have something like libssh-devel pre-installed.

webknjaz commented 1 month ago

It's roughly mentioned @ https://ansible-pylibssh.rtfd.io/en/latest/installation_guide/#installing-project-from-source-distribution-pypi.

qqkkll commented 1 month ago

thanks a lot.