Python Forum
'SSHClient' object is not callable
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
'SSHClient' object is not callable
#1
Hi! Can anyone help me to fix the below error? Thanks!

Error:
File "", line 12, in <module> ssh_client(IP,port=22, username='admin', password='cisco') TypeError: 'SSHClient' object is not callable
import paramiko
with open('network/routers') as f:
        for IP in f:
                ssh_client=paramiko.SSHClient()
                ssh_client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
                ssh_client(IP,port=22, username='admin', password='cisco')

                stdin, stdout, stderr = ssh_client.exec_command('show version')
                output=stdout.read().decode()
                print(output)
                with open(IP + '_output.txt', 'w') as f:
                        f.write(output)
                
                ssh_client.close()
Reply
#2
Did you mean to call ssh_client.connect(IP,port=22, username='admin', password='cisco')?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  error in class: TypeError: 'str' object is not callable akbarza 2 524 Dec-30-2023, 04:35 PM
Last Post: deanhystad
  TypeError: 'NoneType' object is not callable akbarza 4 1,020 Aug-24-2023, 05:14 PM
Last Post: snippsat
  [NEW CODER] TypeError: Object is not callable iwantyoursec 5 1,388 Aug-23-2023, 06:21 PM
Last Post: deanhystad
  Need help with 'str' object is not callable error. Fare 4 859 Jul-23-2023, 02:25 PM
Last Post: Fare
  TypeError: 'float' object is not callable #1 isdito2001 1 1,089 Jan-21-2023, 12:43 AM
Last Post: Yoriz
  TypeError: 'float' object is not callable TimofeyKolpakov 3 1,473 Dec-04-2022, 04:58 PM
Last Post: TimofeyKolpakov
  API Post issue "TypeError: 'str' object is not callable" makeeley 2 1,935 Oct-30-2022, 12:53 PM
Last Post: makeeley
  Merge htm files with shutil library (TypeError: 'module' object is not callable) Melcu54 5 1,606 Aug-28-2022, 07:11 AM
Last Post: Melcu54
  [split] TypeError: 'int' object is not callable flash77 4 2,775 Mar-21-2022, 09:44 PM
Last Post: deanhystad
  TypeError: 'module' object is not callable SyamPothan 4 4,696 Mar-04-2022, 04:44 PM
Last Post: SyamPothan

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020