partially initialized module 'paramiko' has no attribute 'SSHClient'
Использую код для подключения по SSH:
import paramiko
from ast import In
from paramiko import util
inHost = "localhost"
inUsername = "root"
inPassword = "P@ssw0rd"
# inHost = input("Enter the host address from where to copy the VM: ")
# outHost = input("Enter the host address where to copy the VM: ")
# inUsername = input("Enter the username for the server where the VM will be copied from: ")
# outUsername = input("Enter the username for the server where the VM will be copied to: ")
# inPassword = input("Enter the password for the user from whose server the copy will be made: ")
# outPassw0rd = input("Enter the password for the user to whose server the copy will be made: ")
# InSSHPort = input("Enter the SSH port( If the port is standard, do not enter anything) : ")
# OutSSHPort = input("Enter the SSH port( If the port is standard, do not enter anything) : ")
InSSHPort = "22"
# OutSSHPort = "22"
# Initialize connection to servers
# SRV1 from where to copy
# SRV2 Where to copy
SRV1 = paramiko.SSHClient()
SRV1.set_missing_host_key_policy(paramiko.AutoAddPolicy())
SRV1.connect(hostname=inHost, username=inUsername, password=inPassword, port=InSSHPort)
но при запуске получаю кучу ошибок и не знаю как исправить:
└─$ /bin/python3.10 /home/hramoff/Desktop/VMwareCopy/copy.py
Traceback (most recent call last):
File "/home/hramoff/Desktop/VMwareCopy/copy.py", line 1, in <module>
import paramiko
File "/usr/lib/python3/dist-packages/paramiko/__init__.py", line 22, in <module>
from paramiko.transport import SecurityOptions, Transport
File "/usr/lib/python3/dist-packages/paramiko/transport.py", line 37, in <module>
from paramiko import util
File "/usr/lib/python3/dist-packages/paramiko/util.py", line 34, in <module>
from paramiko.config import SSHConfig
File "/usr/lib/python3/dist-packages/paramiko/config.py", line 36, in <module>
import invoke
File "/usr/lib/python3/dist-packages/invoke/__init__.py", line 2, in <module>
from .collection import Collection # noqa
File "/usr/lib/python3/dist-packages/invoke/collection.py", line 1, in <module>
import copy
File "/home/hramoff/Desktop/VMwareCopy/copy.py", line 29, in <module>
SRV1 = paramiko.SSHClient()
AttributeError: partially initialized module 'paramiko' has no attribute 'SSHClient' (most likely due to a circular import)