Skip to content

[BUG] - ImportError: Cannot import name 'DSSKey' from 'paramiko' #2535

Description

@geovalexis

Are you using paramiko as a client or server?

Client

What feature(s) aren't working right?

Keys/auth

What version(s) of paramiko are you using?

4.0.0

What version(s) of Python are you using?

3.9

What operating system and version are you using?

Ubuntu 20.04

If you're connecting as a client, which SSH server are you connecting to?

MFT

If you're using paramiko as part of another tool, which tool/version?

pysftp v0.29

Expected/desired behavior

Perform a simple file transfer (PUT) to a MFT server over SFTP. We are using pysftp library, a wrapper of paramiko.

Actual behavior

The transfer fails at the very beggining with "ImportError: cannot import name 'DSSKey' from 'paramiko'".

Here is the traceback:

/local_disk0/.ephemeral_nfs/cluster_libraries/python/lib/python3.9/site-packages/pysftp/__init__.py in <module>
     12 import paramiko
     13 from paramiko import SSHException, AuthenticationException   # make available
---> 14 from paramiko import AgentKey, RSAKey, DSSKey
     15 
     16 from pysftp.exceptions import (CredentialException, ConnectionException,

ImportError: cannot import name 'DSSKey' from 'paramiko' (/local_disk0/.ephemeral_nfs/cluster_libraries/python/lib/python3.9/site-packages/paramiko/__init__.py)

How to reproduce

import pysftp

cnopts = pysftp.CnOpts()
cnopts.hostkeys = None

# Connect to the SFTP server and upload the file
with pysftp.Connection(
    sftp_host, port=sftp_port, username=sftp_username, password=sftp_password, cnopts=cnopts
) as sftp:
    sftp.put(local_path, sftp_remote_path)

Anything else?

This process started failing today around 01.00 UTC at the time the new paramiko version was released.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions