我正在使用以下代码执行 sftp:#!/opt/python3/bin/python3
import paramiko
import sys
host = '192.168.1.2'
port = 22622
transport = paramiko.Transport((host, port))
password = "p@ssw0rd"
username = "web"
transport.connect(username = username, password = password)
sftp = paramiko.SFTPClient.from_transport(transport)
path = '/log/ERROR.LOG'
localpath = '/home/web/ERROR.LOG'
sftp.get(path, localpath)
sftp.close()
transport.close()
print ("Download done.")
但输出是:
Traceback (most recent call last):
File "c.py", line 2, in <module>
import paramiko
ImportError: No module named paramiko
Python3 没有 Paramiko 模块吗?
我必须使用什么来执行 sftp?