ParallelSSH / ssh2-python

Python bindings for libssh2 C library.
https://parallel-ssh.org
GNU Lesser General Public License v2.1
228 stars 70 forks source link

Unable to install via pip on python 3.10 #160

Closed JacobCallahan closed 2 years ago

JacobCallahan commented 2 years ago

Bug reports

I am unable to install ssh2-python on systems with Python 3.10.

Steps to reproduce:

  1. Be on a python 3.10 system (potentially linux only)
  2. pip install ssh2-python

Expected behaviour: ssh2-python installs successfully like in previous python versions.

Actual behaviour: the package fails to build, see below for full output

Additional info:

Reproducible on:

Collecting ssh2-python
  Downloading ssh2-python-0.26.0.tar.gz (1.1 MB)
     |████████████████████████████████| 1.1 MB 3.1 MB/s 
Building wheels for collected packages: ssh2-python
  Building wheel for ssh2-python (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/local/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-xexeheh5/ssh2-python_f5296b320aa64158990e2ca6ce84db8a/setup.py'"'"'; __file__='"'"'/tmp/pip-install-xexeheh5/ssh2-python_f5296b320aa64158990e2ca6ce84db8a/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-tss1xwng
       cwd: /tmp/pip-install-xexeheh5/ssh2-python_f5296b320aa64158990e2ca6ce84db8a/
  Complete output (10 lines):
  /bin/sh: 1: cmake: not found
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-install-xexeheh5/ssh2-python_f5296b320aa64158990e2ca6ce84db8a/setup.py", line 34, in <module>
      build_ssh2()
    File "/tmp/pip-install-xexeheh5/ssh2-python_f5296b320aa64158990e2ca6ce84db8a/_setup_libssh2.py", line 21, in build_ssh2
      check_call('cmake ../libssh2 -DBUILD_SHARED_LIBS=ON \
    File "/usr/local/lib/python3.10/subprocess.py", line 369, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command 'cmake ../libssh2 -DBUILD_SHARED_LIBS=ON     -DENABLE_ZLIB_COMPRESSION=ON -DENABLE_CRYPT_NONE=ON     -DENABLE_MAC_NONE=ON -DCRYPTO_BACKEND=OpenSSL' returned non-zero exit status 127.
  ----------------------------------------
  ERROR: Failed building wheel for ssh2-python
  Running setup.py clean for ssh2-python
Failed to build ssh2-python
Installing collected packages: ssh2-python
    Running setup.py install for ssh2-python ... error
    ERROR: Command errored out with exit status 1:
     command: /usr/local/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-xexeheh5/ssh2-python_f5296b320aa64158990e2ca6ce84db8a/setup.py'"'"'; __file__='"'"'/tmp/pip-install-xexeheh5/ssh2-python_f5296b320aa64158990e2ca6ce84db8a/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-tbnhbts_/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.10/ssh2-python
         cwd: /tmp/pip-install-xexeheh5/ssh2-python_f5296b320aa64158990e2ca6ce84db8a/
    Complete output (10 lines):
    /bin/sh: 1: cmake: not found
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-xexeheh5/ssh2-python_f5296b320aa64158990e2ca6ce84db8a/setup.py", line 34, in <module>
        build_ssh2()
      File "/tmp/pip-install-xexeheh5/ssh2-python_f5296b320aa64158990e2ca6ce84db8a/_setup_libssh2.py", line 21, in build_ssh2
        check_call('cmake ../libssh2 -DBUILD_SHARED_LIBS=ON \
      File "/usr/local/lib/python3.10/subprocess.py", line 369, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command 'cmake ../libssh2 -DBUILD_SHARED_LIBS=ON     -DENABLE_ZLIB_COMPRESSION=ON -DENABLE_CRYPT_NONE=ON     -DENABLE_MAC_NONE=ON -DCRYPTO_BACKEND=OpenSSL' returned non-zero exit status 127.
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-xexeheh5/ssh2-python_f5296b320aa64158990e2ca6ce84db8a/setup.py'"'"'; __file__='"'"'/tmp/pip-install-xexeheh5/ssh2-python_f5296b320aa64158990e2ca6ce84db8a/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-tbnhbts_/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.10/ssh2-python Check the logs for full command output.
pkittenis commented 2 years ago

Thanks for the report.

Resolved in master, pending new release.

pkittenis commented 2 years ago

Resolved by 0.27.0